I’m working on a bookings webpage, where there are two type of users:
The Suppliers and Consumers
The Suppliers would create their services through me (giving me the info, then i add the service to the website), and the Consumers would be able to book the sessions for the services.
I want the suppliers to be able to manage the services they’re in charge of, so among other things I want them to be able to create appointments.
I unfortunately there is no way to such staff permission, that does what I want. I know about “bookings staff member” but it doesn’t let them add new appintments
So i came up with a solution:
I created an admin page where members with the permissions can create new sessions using
wix-bookings-backend -s sessions.createSession() method and at first it looked like it works, when i want to book the session created by code a time slot appers on the Booking Calendar page but when i try to click it to book it an error occurs:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘id’)
at Object.getBookingPreferenceOptionFromSlot (bookingPreferences.ts:61:60)
at eval (bookingPreferencesForSelectedTime.ts:105:66)
at Array.forEach ()
at nt (bookingPreferencesForSelectedTime.ts:104:33)
at eval (bookingPreferencesForSelectedTime.ts:54:23)
at Array.map ()
at tt (bookingPreferencesForSelectedTime.ts:50:29)
at et (bookingPreferencesForSelectedTime.ts:28:10)
at kt (bookingDetailsViewModel.tsx:168:30)
at Object.createViewModel (sidebarViewModel.ts:40:30)
It seems to be an internal error, i don’t know how to fix it
You can check it at www.fogli .hu
(click on the service “Macaron workshop” then try to book for january 30. 3:00 am and look at developer console)
Any help would be really appreciated either helping me fix the coding error, or if you have other ideas about how to make a different solution for my problem without using createService()
Thanks in advance!