Skip to content

Commit

Permalink
fix: fieldName passed dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhishekPAnil committed Sep 30, 2024
1 parent 3fdc73a commit f48fac5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/constants/formFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ const rules = [
},
{
dataType: dataTypes.IDENTITY_STRING,
rule: ({ t }) => [
rule: ({ t, fieldName }) => [
({ getFieldValue }) => ({
validator() {
if (getFieldValue('location')) return Promise.resolve();
if (getFieldValue(fieldName)) return Promise.resolve();
else return Promise.reject(new Error(t('common.validations.informationRequired')));
},
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,6 @@ function CreateNewOrganization() {
validateFieldList = validateFieldList?.concat(
formFieldProperties?.mandatoryFields?.dynamicFields?.map((field) => ['dynamicFields', field]),
);
console.log(form.getFieldsError(['location']));
console.log(form.getFieldInstance('location'));
console.log(form.getFieldError('location'));

var promise = new Promise(function (resolve, reject) {
form
Expand Down

0 comments on commit f48fac5

Please sign in to comment.