Search.../

onPolicyDeleted( )

A backend event that fires when a Policy is deleted.

Description

The onPolicyDeleted() event handler runs when a Policy is deleted in your site. The received PolicyDeleted object contains information about the deleted policy.

Note: Backend events are not fired when previewing your site.

Syntax

function wixEvents_onPolicyDeleted(event: PolicyDeleted): void

onPolicyDeleted Parameters

NAME
TYPE
DESCRIPTION
event
Optional
PolicyDeleted

Information about the onPolicyDeleted event.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

A backend event that occurs when a policy is deleted

Copy Code
1// Place this code in the events.js file
2// of your site's Backend section.
3// Add the file if it doesn't exist.
4
5export function wixEvents_onPolicyDeleted(event) {
6 const eventId = event.metadata.id
7 const entityId = event.entity._id;
8 }
9
10 /* Full policy object:
11{
12 "metadata": {
13 "id": "4ef5a02f-5263-48d9-9ed6-01e90c2ebeb0",
14 "entityId": "c416e5a2-4518-4765-9cf0-b0d980f45a16",
15 "eventTime": "2023-03-08T11:51:58.371593Z",
16 "triggeredByAnonymizeRequest": false
17 }
18}
19*/
20