From b9aee3b18c6bf9c5d55f61ca3581f1b9dec0b651 Mon Sep 17 00:00:00 2001 From: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com> Date: Wed, 20 Aug 2025 22:27:52 -0400 Subject: [PATCH] fix: Add guests via URL param even if field is hidden (#23229) * Add guests via URL param even if field is hidden * Clean up --- packages/features/bookings/lib/getCalEventResponses.ts | 5 +++-- .../features/bookings/lib/handleNewBooking/getBookingData.ts | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) 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,