This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Deletes a resource.
The deleteResource()
function returns a Promise that is resolved when a resource is deleted.
Deleting a resource updates its status to DELETED
.
You cannot delete a resource if it has booked sessions.
Notes:
"business"
. This resource is used for the business's schedule and working hours and cannot be deleted.This function requires elevated permissions and runs only on the backend and on dashboard pages.
function deleteResource(_id: string): Promise<DeleteResourceResponse>;
ID of the resource to delete.
import { resources } from "wix-bookings.v1";
async function deleteResource(id) {
try {
const result = await resources.deleteResource(id);
return result;
} catch (error) {
console.error(error);
// Handle the error
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.