Search...
updateResource( )
Developer Preview
Updates a resource.
Description
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 is not a universal function and runs only on the backend.
Syntax
function updateResource(_id: string, resource: wix-bookings-v1.Resources.UpdateResource): Promise<wix-bookings-v1.Resources.UpdateResourceResponse>
updateResource Parameters
NAME
TYPE
DESCRIPTION
_id
string
Resource ID.
resource
UpdateResource
Resource to update.
Returns
Return Type:
Promise<
UpdateResourceResponse
>Was this helpful?
updateResource example
Copy Code
1import { resources } from 'wix-bookings.v1';23 async function updateResource(id, resource, options) {4 try {5 const result = await resources.updateResource(id, resource, options);67 return result;8 } catch (error) {9 console.error(error);10 // Handle the error11 }12 }13