Search.../

onGalleryUpdated( )

An event that triggers when a gallery is updated.

Description

The onGalleryUpdated() event handler runs when a gallery has been updated. The received GalleryUpdated object contains information about the gallery that was updated.

Notes:

  • Backend events don't work when previewing your site.
  • The event data doesn't include gallery items or their IDs. To get information about the updated items in your updated gallery, listen for the onGalleryItemUpdated() event.

Syntax

function onGalleryUpdated(event: GalleryUpdated): void

onGalleryUpdated Parameters

NAME
TYPE
DESCRIPTION
event
Optional
GalleryUpdated

Information about an updated gallery.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

An event triggered when a gallery is updated

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 wixProGallery_onGalleryUpdated(event) {
6 const galleryId = event.entity._id;
7 const galleryName = event.entity.name;
8 const eventId = event.metadata.id;
9 const eventTime = event.metadata.eventTime;
10}
11
12/* Full event object:
13 * {
14 * "entity": {
15 * "_createdDate": "2022-08-04T10:00:09.000Z",
16 * "_id": "b082d5aa-1e7b-44d9-91f3-ab0387825de5",
17 * "items": [],
18 * "name": "My Updated Gallery",
19 *. "sortOrder": 1,
20 * "totalItems": 2
21 * },
22 * "metadata": {
23 * "entityId": "b082d5aa-1e7b-44d9-91f3-ab0387825de5",
24 * "eventTime": "2022-08-04T10:00:09.559484Z",
25 * "id": "1586937f-a154-4ad1-8ccf-488a63852e63",
26 * "triggeredByAnonymizeRequest": false
27 * }
28 * }
29 */