chore: ensures default validate functions receive field config
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user