From 99d0816d9fa60bde19a47425941a63a6a903d52a Mon Sep 17 00:00:00 2001 From: Hariom Balhara Date: Thu, 24 Aug 2023 18:13:52 +0530 Subject: [PATCH] phoneSchema missing async parsing (#10929) --- 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 141362a841..70417effa0 100644 --- a/packages/features/bookings/lib/getBookingResponsesSchema.ts +++ b/packages/features/bookings/lib/getBookingResponsesSchema.ts @@ -223,7 +223,7 @@ function preprocess({ if (optionValue) { // `typeOfOptionInput` can be any of the main types. So, we the same validations should run for `optionValue` if (typeOfOptionInput === "phone") { - if (!phoneSchema.safeParse(optionValue).success) { + if (!(await phoneSchema.safeParseAsync(optionValue)).success) { ctx.addIssue({ code: z.ZodIssueCode.custom, message: m("invalid_number") }); } }