diff options
Diffstat (limited to 'ui-react')
-rw-r--r-- | ui-react/src/components/dialogs/Policy/PolicyDeploymentEditor.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ui-react/src/components/dialogs/Policy/PolicyDeploymentEditor.js b/ui-react/src/components/dialogs/Policy/PolicyDeploymentEditor.js index d15c73930..57d61600a 100644 --- a/ui-react/src/components/dialogs/Policy/PolicyDeploymentEditor.js +++ b/ui-react/src/components/dialogs/Policy/PolicyDeploymentEditor.js @@ -75,10 +75,14 @@ export default class PolicyDeploymentEditor extends React.Component { let commandsArray = []; initialStates.forEach(initElem => { let newStateFound = newStates.find(newElement => newElement.name === initElem.name); - if (initElem.value !== newStateFound.value && initElem.value) { + if (initElem.value !== newStateFound.value) { let newPdpGroupsArray = newStateFound.name.split("/"); - commandsArray.push("DELETE/"+newPdpGroupsArray[0] + "/"+newPdpGroupsArray[1] + "/"+this.state.policyData.name - + "/" + this.state.policyData.version); + let operation = "POST/"; + if (initElem.value) { + operation = "DELETE/"; + } + commandsArray.push(operation + newPdpGroupsArray[0] + "/"+newPdpGroupsArray[1] + "/" + +this.state.policyData.name + "/" + this.state.policyData.version); } }); return commandsArray.length > 0 ? {"PdpActions":commandsArray} : undefined; @@ -102,7 +106,6 @@ export default class PolicyDeploymentEditor extends React.Component { }); this.props.policiesTableUpdateFunction(); } - this.props.policiesTableUpdateFunction() }) } else { this.setState({ |