Skip to content

Commit

Permalink
PDE-4989 Remove error due to required "perform" when bulk/perfomBulk …
Browse files Browse the repository at this point in the history
…is set
  • Loading branch information
kola-er committed May 8, 2024
1 parent ade59f6 commit 8ba6180
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/schema/lib/utils/makeValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,14 @@ const makeValidator = (mainSchema, subSchemas) => {
return {
validate: (definition) => {
const results = v.validate(definition, mainSchema);
const allErrors = results.errors.concat(
let allErrors = results.errors.concat(
functionalConstraints.run(definition, mainSchema)
);

allErrors = allErrors.filter((error) => {
// remove errors with message 'requires property "perform"' when definition[action] has bulk/performBulk set.
});

const cleanedErrors = flattenDeep(
allErrors.map((e) => cleanError(e, '', v, definition))
);
Expand Down

0 comments on commit 8ba6180

Please sign in to comment.