From 8a34b5712aeff710b0955ef51bb55d19678e2203 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Mon, 20 Jun 2016 10:43:31 -0700 Subject: [PATCH] returning promise in resolve for setup menu --- awx/ui/client/src/setup-menu/setup.route.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/awx/ui/client/src/setup-menu/setup.route.js b/awx/ui/client/src/setup-menu/setup.route.js index 4a1d199018..dd92b86be6 100644 --- a/awx/ui/client/src/setup-menu/setup.route.js +++ b/awx/ui/client/src/setup-menu/setup.route.js @@ -18,12 +18,12 @@ export default { $rootScope.orgAdmin = true; } else { Rest.setUrl(`/api/v1/users/${$rootScope.current_user.id}/admin_of_organizations`); - Rest.get() - .success(function(data) { - $rootScope.orgAdmin = (data.count) ? true : false; - }).error(function (data, status) { - ProcessErrors($rootScope, data, status, null, { hdr: 'Error!', msg: 'Failed to find if users is admin of org' + status }); - }); + return Rest.get().then(function(data){ + $rootScope.orgAdmin = (data.data.count) ? true : false; + }) + .catch(function (data, status) { + ProcessErrors($rootScope, data, status, null, { hdr: 'Error!', msg: 'Failed to find if users is admin of org' + status }); + }); } } else{