diff --git a/src/views/users.js b/src/views/users.js index 33ff7b2b1..d38cf78e2 100644 --- a/src/views/users.js +++ b/src/views/users.js @@ -18,7 +18,7 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio ]; $scope.ready = false; - $scope.users = []; + $scope.users = []; // users of current page $scope.allUsersById = []; $scope.groups = []; $scope.groupsById = { }; @@ -37,7 +37,7 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio { id: 'owner', name: 'Superadmin', disabled: true } ]; - $scope.allUsers = []; + $scope.allUsers = []; // all the users and not just current page, have to load this for group assignment $scope.userSearchString = ''; $scope.currentPage = 1; @@ -674,27 +674,7 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio }); } - function getGroups(callback) { - var groups = []; - - Client.getGroups(function (error, results) { - if (error) return console.error(error); - - async.eachLimit(results, 20, function (result, iteratorDone) { - Client.getGroup(result.id, function (error, group) { - if (error) return iteratorDone(error); - - groups.push(group); - - iteratorDone(); - }); - }, function (error) { - callback(error, groups); - }); - }); - } - - function refreshUsers(showBusy) { + function refreshUsers(showBusy) { // loads users on current page only if (showBusy) $scope.userRefreshBusy = true; getUsers(function (error, result) { @@ -708,7 +688,7 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio } function refresh() { - getGroups(function (error, result) { + Client.getGroups(function (error, result) { if (error) return console.error('Unable to get group listing.', error); angular.copy(result, $scope.groups); @@ -746,7 +726,7 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio refreshUsers(); }; - function refreshAllUsers() { + function refreshAllUsers() { // this loads all users on Cloudron, not just current page Client.getUsers(function (error, results) { if (error) return console.error(error);