phoneSchema missing async parsing (#10929)

pull/10932/head^2
Hariom Balhara 2023-08-24 18:13:52 +05:30 committed by GitHub
parent 95f4b89fe8
commit 99d0816d9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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") });
}
}