I think this is related, so adding it to this thread, but we could also start a new one. I am flabbergasted by the error from this code. Any insight?
import { sessions } from "wix-bookings-backend";
export async function createNonRecurringSessions(sched, sdate, edate) {
let start = new Date(sdate)
let end = new Date(edate)
const sessionInfo = {
scheduleId: sched,
start: {
timestamp: new Date(sdate)
},
end: {
timestamp: new Date(edate)
},
type: "EVENT",
tags: ["Blocked"]
};
const options = { suppressAuth: true };
return sessions.createSession(sessionInfo, options)
.then((session) => {
return session;
})
.catch((error) => {
console.error('Failed to create session:', error);
});
Failed to create session:
message:
'entity_not_found,
details: {
"entity":"schedule",
"scheduleId":"b263b6c9-efa9-407e-b096-114512ab2d03",
"targetDate":"",
"scheduleVersion":""
}
: Not Found'
details:
applicationError:
description: Not Found
code: NOT_FOUND
data: {}