Skip to content

Commit

Permalink
fix(resolvers): ensure correct async validation for valibot
Browse files Browse the repository at this point in the history
  • Loading branch information
Mini-ghost committed Oct 10, 2023
1 parent a28212b commit 7c9e33c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/resolvers/valibot/src/valibot.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { toNestError } from '@vorms/resolvers';
import { parse } from 'valibot';
import { parseAsync } from 'valibot';

import type { Resolver } from './types';
import type { Issues } from 'valibot';
Expand All @@ -26,7 +26,7 @@ const parseErrorSchema = (valibotIssues: Issues) => {

export const valibotResolver: Resolver = (schema) => async (values) => {
try {
parse(schema, values);
await parseAsync(schema, values);
return {};
} catch (error: any) {
if (error.name !== 'ValiError') throw error;
Expand Down

0 comments on commit 7c9e33c

Please sign in to comment.