diff --git a/packages/features/bookings/lib/getCalEventResponses.ts b/packages/features/bookings/lib/getCalEventResponses.ts index 21a0318e4e..a3360b6ee7 100644 --- a/packages/features/bookings/lib/getCalEventResponses.ts +++ b/packages/features/bookings/lib/getCalEventResponses.ts @@ -13,6 +13,7 @@ export const getCalEventResponses = ({ bookingFields, booking, responses, + seatsEnabled, }: { // If the eventType has been deleted and a booking is Accepted later on, then bookingFields will be null and we can't know the label of fields. So, we should store the label as well in the DB // Also, it is no longer straightforward to identify if a field is system field or not @@ -32,6 +33,7 @@ export const getCalEventResponses = ({ }; }>; responses?: z.infer; + seatsEnabled?: boolean; }) => { const calEventUserFieldsResponses = {} as NonNullable; const calEventResponses = {} as NonNullable; @@ -61,8 +63,7 @@ export const getCalEventResponses = ({ throw new Error(`Missing label for booking field "${field.name}"`); } - // If the guests field is hidden (disableGuests is set on the event type) don't try and infer guests from attendees list - if (field.name == "guests" && field.hidden) { + if (field.name == "guests" && !!seatsEnabled) { backwardCompatibleResponses[field.name] = []; } diff --git a/packages/features/bookings/lib/handleNewBooking/getBookingData.ts b/packages/features/bookings/lib/handleNewBooking/getBookingData.ts index 553e356e55..32c6fec993 100644 --- a/packages/features/bookings/lib/handleNewBooking/getBookingData.ts +++ b/packages/features/bookings/lib/handleNewBooking/getBookingData.ts @@ -64,6 +64,7 @@ const _getBookingData = async ({ getCalEventResponses({ bookingFields: eventType.bookingFields, responses, + seatsEnabled: !!eventType.seatsPerTimeSlot, }); return { ...parsedBody,