1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

returning promise in resolve for setup menu

This commit is contained in:
Jared Tabor 2016-06-20 10:43:31 -07:00
parent 2de4a2d0f9
commit 8a34b5712a

View File

@ -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{