Skip to content

Commit

Permalink
fix: async schema validation
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Jul 21, 2023
1 parent acfc389 commit ce632b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/form/CheckboxField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const CheckboxField: React.FC<CheckboxFieldProps> = ({
validate: async (value) => {
if (validate instanceof BooleanSchema) {
try {
validate.validateSync(value);
await validate.validate(value);
} catch (error) {
if (error instanceof ValidationError) {
return error.errors[0];
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const _TextField: React.FC<BaseTextFieldProps & {
validate: async (value) => {
if (validate instanceof Schema) {
try {
validate.validateSync(value);
await validate.validate(value);
} catch (error) {
if (error instanceof ValidationError) {
return error.errors[0];
Expand Down

0 comments on commit ce632b1

Please sign in to comment.