-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UXE-5966] fix: incorrect argument when saving criteria rules engine (#…
- Loading branch information
1 parent
4e9a135
commit 5ca1f13
Showing
3 changed files
with
71 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/services/edge-application-rules-engine-services/v4/helper-criteria.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const isExistenceOperator = (operator) => ['exists', 'does_not_exist'].includes(operator) | ||
|
||
const processCriteria = (criteria) => { | ||
if (!isExistenceOperator(criteria.operator)) { | ||
return criteria | ||
} | ||
|
||
// eslint-disable-next-line no-unused-vars | ||
const { argument, ...processedCriteria } = criteria | ||
return processedCriteria | ||
} | ||
|
||
export const adaptCriteria = (criterias) => { | ||
return criterias.map((criteriaArray) => { | ||
return criteriaArray.map(processCriteria) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters