fix: hidden phone booking field should never need validation (#17564)
Co-authored-by: Udit Takkar <[email protected]>
This commit is contained in:
1 parent
4d38c6d0c7
commit
fc5ad53a6d
1 file changed
+1
-1
@@ -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