Skip to content

Commit

Permalink
fix: use parseAsync insted of resolving parse
Browse files Browse the repository at this point in the history
  • Loading branch information
mkreuzmayr committed Sep 2, 2021
1 parent 6ee624e commit 1aee153
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function toFormikValidationSchema<T>(
return {
async validate(obj: T) {
try {
await Promise.resolve(schema.parse(obj));
await schema.parseAsync(obj);
} catch (err: unknown) {
throw createValidationError(err as z.ZodError<T>);
}
Expand Down

0 comments on commit 1aee153

Please sign in to comment.