Warn the user on group deletion if it still has members

This commit is contained in:
Johannes Zellner
2016-02-13 12:42:38 +01:00
parent 754e33af2a
commit 7c243cb219
3 changed files with 21 additions and 1 deletions

View File

@@ -86,6 +86,7 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
error: {},
group: null,
password: '',
memberCount: 0,
show: function (group) {
$scope.groupRemove.busy = false;
@@ -98,7 +99,13 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
$scope.groupRemoveForm.$setUntouched();
$scope.groupRemoveForm.$setPristine();
$('#groupRemoveModal').modal('show');
Client.getGroup(group.id, function (error, result) {
if (error) return console.error('Unable to fetch group information.', error.statusCode, error.message);
$scope.groupRemove.memberCount = result.userIds.length;
$('#groupRemoveModal').modal('show');
});
},
submit: function () {