function wixMediaSiteMedia_onFolderUpdated(event: FolderUpdated): void;
Information about the updated file and metadata for the 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 wixMediaSiteMedia_onFolderUpdated(event) {
const displayName = event.entity.displayName;
const parentFolderId = event.entity.parentFolderId;
const eventTime = event.metadata.eventTime;
console.log(
`Folder, "${displayName}," that is found in the folder with ID ${parentFolderId}, was updated at ${eventTime}.`,
);
}
/* Full event object:
* {
* "entity": {
* "_createdDate": "2023-08-21T05:34:03.000Z",
* "_id": "302fc049d70c41dea33fa4a27ab481ba",
* "_updatedDate": "2023-09-18T10:20:49.000Z",
* "displayName": "Folder31",
* "parentFolderId": "media-root"
* },
* "metadata": {
* "entityId": "302fc049d70c41dea33fa4a27ab481ba",
* "eventTime": "2023-09-18T10:20:50.411Z",
* "id": "f5b62b5f-9f83-41d3-b0cd-8cae506b3d35",
* "triggeredByAnonymizeRequest": false
* }
* }
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.