This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Deletes a gallery.
When a gallery is deleted, the deleted gallery is no longer returned when calling the listGalleries()
function.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function deleteGallery(
galleryId: string,
options: DeleteGalleryOptions,
): Promise<DeleteGalleryResponse>;
ID of the gallery to delete.
import { proGallery } from "wix-pro-gallery-backend";
// Sample galleryId value: 'f7cca0a0-5bb5-44c2-a0f8-6496430b3154'
export async function myDeleteGalleryFunction(galleryId) {
try {
const deletedGalleryId = await proGallery.deleteGallery(galleryId);
console.log("Success! Deleted the gallery:", deletedGalleryId);
return deletedGalleryId;
} catch (error) {
console.error(error);
// Handle the error
}
}
/* Promise resolves to:
* {
* "galleryId": "f7cca0a0-5bb5-44c2-a0f8-6496430b3154"
* }
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.