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; $rootScope.orgAdmin = true;
} else { } else {
Rest.setUrl(`/api/v1/users/${$rootScope.current_user.id}/admin_of_organizations`); Rest.setUrl(`/api/v1/users/${$rootScope.current_user.id}/admin_of_organizations`);
Rest.get() return Rest.get().then(function(data){
.success(function(data) { $rootScope.orgAdmin = (data.data.count) ? true : false;
$rootScope.orgAdmin = (data.count) ? true : false; })
}).error(function (data, status) { .catch(function (data, status) {
ProcessErrors($rootScope, data, status, null, { hdr: 'Error!', msg: 'Failed to find if users is admin of org' + status }); ProcessErrors($rootScope, data, status, null, { hdr: 'Error!', msg: 'Failed to find if users is admin of org' + status });
}); });
} }
} }
else{ else{