Hi all!
I’m using wix bookings backend on my site to create sessions from the code.
Unfortunately it has a bug
I’m using the following code:
$w("#button5").onClick(()=>{
let sessionInfo={
scheduleId:'bcaad087-c2b7-4158-a4c2-2afe5ab845c6',
start:{ timestamp: new Date(2022, 0, 28, 9) },
end:{ timestamp: new Date(2022, 0, 28, 10, 30) },
}
myCreateSession(sessionInfo, {suppressAuth:true}).then((session)=>{
console.log(session);
})
.catch((err)=>{
console.log('SOMETHING WENT WRONG', err);
})
})
The backend function looks like this:
export function myCreateSession(sessionInfo, options){
return sessions.createSession(sessionInfo, options);
}
It creates a session that from the sessions query looks just like any other session that was added trough the calendar.
However when i look at it from the calendar it seems to be missing the location info, and the staff member info.
It should inherit thoose from the schedule, but it doesn’t, and it results in the following error when somebody tries to book the session:
I’m looking for ideas for solving this bug, or somehow getting around it.
Thanks in advance!