Hi, I have recently started using Corvid, so I apologize in advance for any inaccuracies.
My main problem is using the wix-booking API, because when I try to use the getServiceAvailability( ) call I get the slots._id in a much longer format than the one shown in the documentation, as you can see here.
The fact that the slots._id are so long prevents me from using them for various things like:
- pass them as dropdown input ( error because > 400 characters )
- use them as argument in a checkoutOptions request ( always return “undefined” result)
I tried as I saw suggested to others, to open a ticket to the support, I was told that they will look into, and f or the time display the slots in a repeater. This worked, but does not solve the problem.
My question is if this is a known problem and has already been solved by someone, or if I am wrong about something.
I have minimized the code used in my example page:
import wixBookings from ‘wix-bookings’ ;
$w.onReady( function () {
});
let availableSlots;
export function bookButton_click(event) {
// Add your code for this event here:
const serviceId = event.context.itemId;
wixBookings.getServiceAvailability(event.context.itemId)
.then( (availability) => {
availableSlots = availability.slots;
let firstSlot = availableSlots[ 0 ];
console.log(firstSlot);
} );
}
Here you can see the output of the console.
Thanks in advance for any contribution