diff options
Diffstat (limited to 'ui-react/src/api/LoopService.js')
-rw-r--r-- | ui-react/src/api/LoopService.js | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/ui-react/src/api/LoopService.js b/ui-react/src/api/LoopService.js index 698ee28c2..3b9ed86fa 100644 --- a/ui-react/src/api/LoopService.js +++ b/ui-react/src/api/LoopService.js @@ -226,22 +226,21 @@ export default class LoopService { credentials: 'same-origin' }) .then(function (response) { - console.debug("Add Operational Policy response received: ", response.status); + console.debug("Add Operational Policy response received: ", response.status); if (response.ok) { return response.json(); } else { - console.error("Add Operational Policy query failed"); - return {}; + return response.text(); } }) - .catch(function (error) { - console.error("Add Operational Policy error received", error); - return {}; - }); + .then(function (object) { + console.error("Add Operational Policy query failed"); + throw new Error(object); + }) } - static removeOperationalPolicyType(loopName, policyType, policyVersion) { - return fetch('/restservices/clds/v2/loop/removeOperationaPolicy/' + loopName + '/policyModel/' + policyType +'/' + policyVersion , { + static removeOperationalPolicyType(loopName, policyType, policyVersion, policyName) { + return fetch('/restservices/clds/v2/loop/removeOperationaPolicy/' + loopName + '/policyModel/' + policyType +'/' + policyVersion + '/' + policyName , { method: 'PUT', headers: { "Content-Type": "application/json" |