Search.../

updateSchedule( )

Developer Preview

Updates a resource's schedule.

Description

The updateSchedule() function returns a Promise that resolves when a resource's schedule has been updated. Use this function to update the bookings resource's schedule. To update other resource details use updateResource().

Notes:

  • A resource can have one schedule only.
  • When updating a resource's schedule you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values "INDIVIDUAL", "GROUP", and "COURSE".

This function is not a universal function and runs only on the backend.

Syntax

function updateSchedule(resourceId: string, schedule: wix-bookings-v1.Resources.Schedule): Promise<wix-bookings-v1.Resources.UpdateScheduleResponse>

updateSchedule Parameters

NAME
TYPE
DESCRIPTION
resourceId
string

Resource ID to update.

schedule
Schedule

Schedule to update.

Returns

Return Type:

Promise<
UpdateScheduleResponse
>

Was this helpful?

updateSchedule example

Copy Code
1import { resources } from 'wix-bookings.v1';
2
3 async function updateSchedule(resourceId, schedule, options) {
4 try {
5 const result = await resources.updateSchedule(resourceId, schedule, options);
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13