diff --git a/src/core_modules/capture-core/components/D2Form/field/validators/getValidators.js b/src/core_modules/capture-core/components/D2Form/field/validators/getValidators.js index 2bba344e3c..f9fb35be3c 100644 --- a/src/core_modules/capture-core/components/D2Form/field/validators/getValidators.js +++ b/src/core_modules/capture-core/components/D2Form/field/validators/getValidators.js @@ -248,7 +248,7 @@ function buildUniqueValidator( ? [ { - validator: (value: any, errorObject: ?Object, contextProps: ?Object) => { + validator: (value: any, internalComponentError?: ?{error: ?string, errorCode: ?string}, contextProps: ?Object) => { if (!value && value !== 0 && value !== false) { return true; } diff --git a/src/core_modules/capture-core/utils/validators/form/ageValidator.js b/src/core_modules/capture-core/utils/validators/form/ageValidator.js index 21e1ac6301..3986f22ebb 100644 --- a/src/core_modules/capture-core/utils/validators/form/ageValidator.js +++ b/src/core_modules/capture-core/utils/validators/form/ageValidator.js @@ -57,7 +57,7 @@ function isAllEmpty(value: AgeValues) { } -export function isValidAge(value: Object, internalComponentError?: Object) { +export function isValidAge(value: Object, internalComponentError?: ?{error: ?string, errorCode: ?string}) { if (isAllEmpty(value)) { return false; } diff --git a/src/core_modules/capture-core/utils/validators/form/dateValidator.js b/src/core_modules/capture-core/utils/validators/form/dateValidator.js index aa7fb35718..ef12190f5b 100644 --- a/src/core_modules/capture-core/utils/validators/form/dateValidator.js +++ b/src/core_modules/capture-core/utils/validators/form/dateValidator.js @@ -1,6 +1,6 @@ // @flow -export function isValidDate(value: ?string, internalComponentError?: Object) { +export function isValidDate(value: ?string, internalComponentError?: ?{error: ?string, errorCode: ?string}) { if (!value) { return { valid: false, errorMessage: null }; }