Skip to content

Commit

Permalink
chore: ensures default validate functions receive field config
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikrut committed Mar 30, 2022
1 parent 60f295b commit 175642c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fields/config/sanitize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const sanitizeFields = (fields, validRelationships: string[]) => {
if (typeof field.validate === 'undefined') {
const defaultValidate = validations[field.type];
if (defaultValidate) {
field.validate = defaultValidate;
field.validate = (val, options) => defaultValidate(val, { ...field, ...options });
} else {
field.validate = () => true;
}
Expand Down

0 comments on commit 175642c

Please sign in to comment.