phoneSchema missing async parsing (#10929)

This commit is contained in:
Hariom Balhara authored and GitHub committed 2023-08-24 12:43:52 +00:00
1 parent 95f4b89fe8
commit 99d0816d9f
1 file changed
+1 -1
@@ -223,7 +223,7 @@ function preprocess<T extends z.ZodType>({
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") });
}
}