Skip to content

Commit

Permalink
EPMRPP-90897 || Notification rule details validation fix (#3831)
Browse files Browse the repository at this point in the history
  • Loading branch information
maria-hambardzumian authored May 15, 2024
1 parent 0634b8d commit 0dfd0c3
Showing 1 changed file with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -449,16 +449,20 @@ const getDynamicFieldValidation = (type, inputValues, ruleFields = []) => {
)(inputValues.recipients),
};
} else {
return ruleFields.reduce((acc, field) => {
const { type: validationType, errorMessage } = field.validation || {};
if (validate[validationType]) {
acc[field.name] = bindMessageToValidator(
validate[validationType],
errorMessage,
)(inputValues[field.name]);
}
return acc;
}, {});
const inputDetails = inputValues[RULE_DETAILS_FIELD_KEY];
return ruleFields.reduce(
(acc, field) => {
const { type: validationType, errorMessage } = field.validation || {};
if (validate[validationType]) {
acc[RULE_DETAILS_FIELD_KEY][field.name] = bindMessageToValidator(
validate[validationType],
errorMessage,
)(inputDetails?.[field.name]);
}
return acc;
},
{ [RULE_DETAILS_FIELD_KEY]: {} },
);
}
};

Expand Down

0 comments on commit 0dfd0c3

Please sign in to comment.