The code that was computing the operations to execute was wrong. THe command POST was missing
Issue-ID: POLICY-3225
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Change-Id: I0de307e782bf99ed3cb4274c587c9c71955bab74
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;