From 2b0da4f9ccdd488005f8b01c94153b4b41cad59c Mon Sep 17 00:00:00 2001 From: thuva4 Date: Wed, 22 Nov 2017 11:08:05 +0530 Subject: showing the response message in the pods page Edit the response from the server and remove the traceback part from the error response. Add create success alert. Change-Id: I887a9ca1b55050d961c6db1141c15203a978aec1 Signed-off-by: thuva4 --- testapi/opnfv_testapi/ui/components/pods/podsController.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'testapi/opnfv_testapi/ui/components/pods/podsController.js') diff --git a/testapi/opnfv_testapi/ui/components/pods/podsController.js b/testapi/opnfv_testapi/ui/components/pods/podsController.js index 489fa8a..9789cf2 100644 --- a/testapi/opnfv_testapi/ui/components/pods/podsController.js +++ b/testapi/opnfv_testapi/ui/components/pods/podsController.js @@ -78,6 +78,7 @@ */ function create() { ctrl.showError = false; + ctrl.showSuccess = false; if(ctrl.name != ""){ var pods_url = ctrl.url; @@ -88,12 +89,11 @@ details: ctrl.details }; ctrl.podsRequest = - $http.post(pods_url, body).error(function (data, status) { + $http.post(pods_url, body).success(function (data) { + ctrl.showSuccess = true ; + }).catch(function (data) { ctrl.showError = true; - if(status == 403){ - ctrl.error = - 'Error creating the new pod from server: Pod\'s name already exists' - } + ctrl.error = "Error creating the new pod from server: " + data.statusText; }); } else{ -- cgit 1.2.3-korg