aboutsummaryrefslogtreecommitdiffstats
path: root/ui-react/src
diff options
context:
space:
mode:
Diffstat (limited to 'ui-react/src')
-rw-r--r--ui-react/src/components/dialogs/Policy/PolicyDeploymentEditor.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/ui-react/src/components/dialogs/Policy/PolicyDeploymentEditor.js b/ui-react/src/components/dialogs/Policy/PolicyDeploymentEditor.js
index a2422e2ad..48d02e38e 100644
--- a/ui-react/src/components/dialogs/Policy/PolicyDeploymentEditor.js
+++ b/ui-react/src/components/dialogs/Policy/PolicyDeploymentEditor.js
@@ -77,8 +77,12 @@ export default class PolicyDeploymentEditor extends React.Component {
let newStateFound = newStates.find(newElement => newElement.name === initElem.name);
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;