summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorS�bastien Determe <sebastien.determe@intl.att.com>2021-04-21 13:28:53 +0000
committerGerrit Code Review <gerrit@onap.org>2021-04-21 13:28:53 +0000
commit008203328093c2f757669bae27573ea057471338 (patch)
treec27ab66e5013fd1c1ea5fcc343cdc8ddfb2762a0
parentf7612ef184bfe3915dae60c6a500dd1500dad3d4 (diff)
parentc727ca5a823487f37bb725750e4f8cbab5991c36 (diff)
Merge "Fix wrong PDP operations send by UI"
-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;