diff --git a/src/app/organization/organizationPeopleController.js b/src/app/organization/organizationPeopleController.js index bd91a7368e5..a08794e0cb1 100644 --- a/src/app/organization/organizationPeopleController.js +++ b/src/app/organization/organizationPeopleController.js @@ -7,6 +7,30 @@ loadList(); }); + $scope.reinvite = function (user) { + apiService.organizationUsers.reinvite({ orgId: $state.params.orgId, id: user.id }, null, function () { + toastr.success(user.email + ' has been invited again.', 'User Invited'); + }, function () { + toastr.error('Unable to invite user.', 'Error'); + }); + }; + + $scope.delete = function (user) { + if (!confirm('Are you sure you want to remove this user (' + user.email + ')?')) { + return; + } + + apiService.organizationUsers.del({ orgId: $state.params.orgId, id: user.id }, null, function () { + toastr.success(user.email + ' has been removed.', 'User Removed'); + var index = $scope.users.indexOf(user); + if (index > -1) { + $scope.users.splice(index, 1); + } + }, function () { + toastr.error('Unable to remove user.', 'Error'); + }); + }; + $scope.confirm = function (user) { apiService.users.getPublicKey({ id: user.userId }, function (userKey) { var orgKey = cryptoService.getOrgKey($state.params.orgId); diff --git a/src/app/organization/views/organizationPeople.html b/src/app/organization/views/organizationPeople.html index 77cc83487fa..cedd2d3dd2b 100644 --- a/src/app/organization/views/organizationPeople.html +++ b/src/app/organization/views/organizationPeople.html @@ -31,8 +31,8 @@