Updates a resource.
The updateResource()
function returns a Promise that resolves when a resource is updated. Use this function to update all bookings resource information except for the resource's schedule. To update a resource's schedule use updateSchedule()
.
Note:
When updating a resource you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values "business"
and "staff"
.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function updateResource(
_id: string,
resource: UpdateResource,
options: UpdateResourceOptions,
): Promise<Resource>;
Resource ID.
Resource to update.
import { resources } from "wix-bookings.v1";
async function updateResource(id, resource, options) {
try {
const result = await resources.updateResource(id, resource, options);
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.