Merge "Fix wrong PDP operations send by UI"
diff --git a/ui-react/src/components/dialogs/Policy/PolicyDeploymentEditor.js b/ui-react/src/components/dialogs/Policy/PolicyDeploymentEditor.js
index a2422e2..48d02e3 100644
--- a/ui-react/src/components/dialogs/Policy/PolicyDeploymentEditor.js
+++ b/ui-react/src/components/dialogs/Policy/PolicyDeploymentEditor.js
@@ -77,8 +77,12 @@
             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;