Search...
onLocationArchiveStatus( )
Developer Preview
Triggered when a location is archived.
Syntax
function onLocationArchiveStatus(event: LocationArchiveStatus): void
onLocationArchiveStatus Parameters
NAME
TYPE
DESCRIPTION
event
Optional
LocationArchiveStatus
Contains information about the archived location and metadata for the event.
Returns
This function does not return anything.
Return Type:
void
Was this helpful?
An event that triggers when a location is archived
Copy Code
1// Place this code in the events.js file2// of your site's Backend section.3// Add the file if it doesn't exist.45export function wixLocations_onLocationArchiveStatus(event) {6 const archivedTime = event.metadata.eventTime;78 console.log(`Location was archived at ${archivedTime}. Event details:`, event)9}1011/* Full event object:12 * {13 * "data": {14 * "_id": "489d0ea1-9eb4-4215-9616-98e297c7337e"15 * },16 * "metadata": {17 * "entityId": "489d0ea1-9eb4-4215-9616-98e297c7337e",18 * "eventTime": "2023-11-13T08:00:47.696025Z",19 * "id": "a92d9e8b-abd7-4903-a954-5a6848f6f4eb",20 * "triggeredByAnonymizeRequest": false21 * }22 * }23 */