A backend event that fires when a Policy is deleted.
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.
function wixEvents_onPolicyDeleted(event: PolicyDeleted): void;
Information about the onPolicyDeleted
event.
// Place this code in the events.js file
// of your site's Backend section.
// Add the file if it doesn't exist.
export function wixEvents_onPolicyDeleted(event) {
const eventId = event.metadata.id;
const entityId = event.entity._id;
}
/* Full policy object:
{
"metadata": {
"id": "4ef5a02f-5263-48d9-9ed6-01e90c2ebeb0",
"entityId": "c416e5a2-4518-4765-9cf0-b0d980f45a16",
"eventTime": "2023-03-08T11:51:58.371593Z",
"triggeredByAnonymizeRequest": false
}
}
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.