Skip to content

Commit

Permalink
#9765: fix issue of not saving edits of attribute rules in rules mana…
Browse files Browse the repository at this point in the history
…ger (#9772)
  • Loading branch information
mahmoudadel54 authored Nov 29, 2023
1 parent 8778ca7 commit 71c7a24
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const getAttributeValue = (name, constraints) => {
export default ({attributes = [], constraints = {}, setOption = () => {}, active = false, setEditedAttributes = () => {}, editedAttributes = []}) => {
const onChange = (at) => {
const {attributes: attrs} = constraints;
const attribute = (attrs && attrs.attribute?.length ? attrs.attribute : [attrs.attribute] || []).filter(e => e.name !== at.name).concat(at);
const attribute = ((attrs && attrs?.attribute?.length) ? attrs.attribute : (attrs?.attribute) ? [attrs.attribute] : [] || []).filter(e => e.name !== at.name).concat(at);
setOption({key: "attributes", value: {attribute}});
// add it to edited attribute
if (!editedAttributes.includes(at.name)) setEditedAttributes(at.name);
Expand Down

0 comments on commit 71c7a24

Please sign in to comment.