Hi. I’m trying to query bookings sessions (with the ultimate goal of allowing an admin to delete all sessions for a given day in a dashbaord page), but I’m getting empty results.
export function clearDay(dateFrom, dateTo) {
let sessionsList = sessions.querySessions()
.ge("end.timestamp", dateFrom)
.lt("start.timestamp", dateTo)
.find({ suppressAuth: true })
.then((results) => {
console.log("query length: " + results.items.length);
if (results.items.length > 0) {
const items = results.items;
console.log("got results");
console.log(results.items);
return results.items;
}
})
.catch((error) => {
console.error(error);
throw (error)
});
return sessionsList
}
although I’m quite sure I’m providing a date range which has actual sessions, I get 0 items… Any idea why? I’m using an Wix App Dev premium website for testing this.