From da2c57c3021292818b1a343613c6d383693e5c21 Mon Sep 17 00:00:00 2001 From: Venkata Rohan Kambhampati <83659881+VenkataRohan@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:03:04 +0530 Subject: [PATCH] fix: Booking questions order correction in confirmation email (#18192) Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> --- .../modules/bookings/views/bookings-single-view.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/web/modules/bookings/views/bookings-single-view.tsx b/apps/web/modules/bookings/views/bookings-single-view.tsx index 0f7662717b..22b5b65429 100644 --- a/apps/web/modules/bookings/views/bookings-single-view.tsx +++ b/apps/web/modules/bookings/views/bookings-single-view.tsx @@ -649,13 +649,17 @@ export default function Success(props: PageProps) { )}
- {Object.entries(bookingInfo.responses).map(([name, response]) => { - const field = eventType.bookingFields.find((field) => field.name === name); + {eventType.bookingFields.map((field) => { + if (!field) return null; + + if (!bookingInfo.responses[field.name]) return null; + + const response = bookingInfo.responses[field.name]; // We show location in the "where" section // We show Booker Name, Emails and guests in Who section // We show notes in additional notes section // We show rescheduleReason at the top - if (!field) return null; + const isSystemField = SystemField.safeParse(field.name); // SMS_REMINDER_NUMBER_FIELD is a system field but doesn't have a dedicated place in the UI. So, it would be shown through the following responses list // TITLE is also an identifier for booking question "What is this meeting about?"