From 175642c07b405c53bac39e2e4e4f23743406ea0b Mon Sep 17 00:00:00 2001 From: James Date: Wed, 30 Mar 2022 15:00:19 -0400 Subject: [PATCH] chore: ensures default validate functions receive field config --- src/fields/config/sanitize.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fields/config/sanitize.ts b/src/fields/config/sanitize.ts index 5a4dbf23550..47a4300e9dc 100644 --- a/src/fields/config/sanitize.ts +++ b/src/fields/config/sanitize.ts @@ -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; }