onPolicyDeleted( )


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.

Method Declaration
Copy
function wixEvents_onPolicyDeleted(event: PolicyDeleted): void;
Method Parameters
eventPolicyDeleted

Information about the onPolicyDeleted event.

A backend event that occurs when a policy is deleted
JavaScript
// 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 } } */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?