diff --git a/packages/features/bookings/lib/getBookingResponsesSchema.ts b/packages/features/bookings/lib/getBookingResponsesSchema.ts index d3e61a883dde0e..d19b8247fc6b3c 100644 --- a/packages/features/bookings/lib/getBookingResponsesSchema.ts +++ b/packages/features/bookings/lib/getBookingResponsesSchema.ts @@ -6,7 +6,6 @@ import { dbReadResponseSchema, fieldTypesSchemaMap } from "@calcom/features/form import type { eventTypeBookingFields } from "@calcom/prisma/zod-utils"; import { bookingResponses, emailSchemaRefinement } from "@calcom/prisma/zod-utils"; -// eslint-disable-next-line @typescript-eslint/ban-types type View = ALL_VIEWS | (string & {}); type BookingFields = (z.infer & z.BRAND<"HAS_SYSTEM_FIELDS">) | null; type CommonParams = { bookingFields: BookingFields; view: View }; @@ -103,7 +102,9 @@ function preprocess({ }; try { parsedValue = JSON.parse(value); - } catch (e) {} + } catch (error) { + console.error("Failed to parse radioInput value as JSON:", error); + } const optionsInputs = field.optionsInputs; const optionInputField = optionsInputs?.[parsedValue.value]; if (optionInputField && optionInputField.type === "phone") { @@ -174,7 +175,7 @@ function preprocess({ } if (bookingField.type === "email") { - if (!bookingField.hidden && checkOptional ? true : bookingField.required) { + if (!bookingField.hidden && checkOptional) { // Email RegExp to validate if the input is a valid email if (!emailSchema.safeParse(value).success) { ctx.addIssue({