> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: updateGallery(_id: string, gallery: UpdateGallery, options: UpdateGalleryOptions) # Method package: wixProGalleryBackend # Method menu location: wixProGalleryBackend --> proGallery --> updateGallery # Method Link: https://dev.wix.com/docs/velo/apis/wix-pro-gallery-backend/pro-gallery/update-gallery.md # Method Description: Updates a gallery. Only the fields in the `gallery` object parameter can be updated. Specify which fields to update. Unspecified fields remain the same.
__Important:__ When updating `image` items in your gallery, the images must be uploaded to the [Wix Media Manager](https://support.wix.com/en/article/wix-media-uploading-media-to-the-media-manager) first as the `imageInfo` parameter currently only supports the Wix media URL.# Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Update a gallery ```javascript import { proGallery } from 'wix-pro-gallery-backend'; /* Sample _id value: '10874ccf-5867-4225-9550-3885079bad66' * * Sample gallery value: * { * "name": "New Name", * "sortOrder": 420 * } */ export async function myUpdateGalleryFunction(_id, gallery) { try { const updatedGallery = await proGallery.updateGallery(_id, gallery); const name = updatedGallery.name; const sortOrder = updatedGallery.sortOrder; console.log('Success! Updated the gallery:', updatedGallery); return updatedGallery; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * { * "_createdDate": "Mon Feb 08 2021 13:44:37", * "_id":"10874ccf-5867-4225-9550-3885079bad66", * "items": [ * { * "_createdDate": Tue Mar 30 2021 15:23:22, * "_id": "534264c7-0c61-45ce-b414-891aacadf4c2", * "_updatedDate": Tue Mar 30 2021 15:23:22, * "description": "This is the first item in my gallery.", * "sortOrder": 1657439075188 * "title": "Item 1" * "type": "IMAGE", * "image": { * "imageInfo": "wix:image://v1/38939f9568z222d6avc6285c9ac1e9129.jpg/38939f9568z222d6avc6285c9ac1e9129.jpg#originWidth=200&originHeight=199" * } * }, * { * "_createdDate": Sun Jul 03 2022 12:05:15, * "_id": "4507a07b-ab93-4326-a222-6d0bd8da0625", * "_updatedDate": Tues Jul 05 2022 10:25:45 * "description": "This is the second item in my gallery.", * "sortOrder": 1857439076299 * "title": "Item 2" * "type": "IMAGE", * "image": { * "imageInfo": "wix:image://v1/25139f9568b74d8aac6286c9ac1e8186.jpg/25139f9568b74d8aac6286c9ac1e8186.jpg#originWidth=4000&originHeight=2667" * } * } * ], * "name": "New Name", * "sortOrder": "420", * "totalItems": 2 * } */ ``` ---