From fc5ad53a6d6ca5b5959059b76bbdb5e082f3e7e4 Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Mon, 11 Nov 2024 20:36:38 +0530 Subject: [PATCH] fix: hidden phone booking field should never need validation (#17564) Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> --- packages/features/bookings/lib/getBookingResponsesSchema.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/features/bookings/lib/getBookingResponsesSchema.ts b/packages/features/bookings/lib/getBookingResponsesSchema.ts index a2357ca243..3045bc1977 100644 --- a/packages/features/bookings/lib/getBookingResponsesSchema.ts +++ b/packages/features/bookings/lib/getBookingResponsesSchema.ts @@ -236,7 +236,7 @@ function preprocess({ } if (bookingField.type === "phone") { - if (!(await phoneSchema.safeParseAsync(value)).success) { + if (!bookingField.hidden && !(await phoneSchema.safeParseAsync(value)).success) { ctx.addIssue({ code: z.ZodIssueCode.custom, message: m("invalid_number") }); } continue;