summaryrefslogtreecommitdiffstats
path: root/ui-react/src/api
diff options
context:
space:
mode:
authorxuegao <xg353y@intl.att.com>2020-04-21 13:39:50 +0200
committerxuegao <xg353y@intl.att.com>2020-04-21 13:39:50 +0200
commitc65613938d30565d4dc913fbf2d48002390119d3 (patch)
tree63cf31d45dad04969c63fdf1f89d3d6deb1c5657 /ui-react/src/api
parent8b4027e3e359bba21014dd138da2545d54d117db (diff)
Prevent adding same type of Op policy
Add the logic to prevent user adding the same type of Operational Policy Issue-ID: CLAMP-828 Change-Id: Iec6774ec7a9494740f7aed0873165ba073d73e45 Signed-off-by: xuegao <xg353y@intl.att.com>
Diffstat (limited to 'ui-react/src/api')
-rw-r--r--ui-react/src/api/LoopService.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/ui-react/src/api/LoopService.js b/ui-react/src/api/LoopService.js
index 698ee28c2..9d3b36983 100644
--- a/ui-react/src/api/LoopService.js
+++ b/ui-react/src/api/LoopService.js
@@ -226,18 +226,17 @@ 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) {