Hey everyone, I am trying to retrieve the general booking appointment hours in the code, but i can't find a way to do it. I tried the method below, but the schedules.availability object that is returned is empty :
import { resources } from "wix-bookings-backend";
//
export function getBusinessSchedule() {
return resources.queryResourceCatalog()
.eq("slugs.name", "business")
.find()
.then(async (results) => {
return results.items[0];
});
}
Returns :
{
"resource": {
"_id": "3e09f698-c511-4a8a-895a-fbb9ab26fa02",
"name": "business",
"tags": [
"business"
],
"scheduleIds": [
"3120dee9-7e01-4e0c-b064-e53cb11375cb"
],
"status": "UPDATED"
},
"schedules": [
{
"availability": {},
"_id": "3120dee9-7e01-4e0c-b064-e53cb11375cb",
"scheduleOwnerId": "3e09f698-c511-4a8a-895a-fbb9ab26fa02"
}
],
"slugs": [
{
"_createdDate": "Wed Apr 14 2021 05:08:09 GMT+0800 (heure de Singapour)",
"name": "business"
}
]
}
Thank you !