fix: hidden phone booking field should never need validation (#17564)

Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
This commit is contained in:
Anik Dhabal Babu
2024-11-11 15:06:38 +00:00
committed by GitHub
co-authored by Udit Takkar
parent 4d38c6d0c7
commit fc5ad53a6d
@@ -236,7 +236,7 @@ function preprocess<T extends z.ZodType>({
}
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;