Search.../

addScheduleItem( )

Adds a schedule item to the draft schedule.

Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Syntax

function addScheduleItem(eventId: string, options: AddScheduleItemOptions): Promise<AddScheduleItemResponse>

addScheduleItem Parameters

NAME
TYPE
DESCRIPTION
eventId
string

Event ID to which the schedule belongs.

options
Optional
AddScheduleItemOptions

Optional fields.

Returns

Return Type:

Promise<
AddScheduleItemResponse
>
NAME
TYPE
DESCRIPTION
item
ScheduleItem

Schedule item.

Was this helpful?

addScheduleItem example

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