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:
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;
|
||||
|
||||
Reference in New Issue
Block a user