diff --git a/src/app/organization/organizationGroupsUsersController.js b/src/app/organization/organizationGroupsUsersController.js index f9ba86ca01..4b3f11887e 100644 --- a/src/app/organization/organizationGroupsUsersController.js +++ b/src/app/organization/organizationGroupsUsersController.js @@ -38,16 +38,17 @@ return; } - //apiService.collectionUsers.del({ orgId: $state.params.orgId, id: user.id }, null, function () { - // toastr.success(user.email + ' has been removed.', 'User Removed'); - // $analytics.eventTrack('Removed User From Collection'); - // var index = $scope.users.indexOf(user); - // if (index > -1) { - // $scope.users.splice(index, 1); - // } - //}, function () { - // toastr.error('Unable to remove user.', 'Error'); - //}); + apiService.groups.delUser({ orgId: $state.params.orgId, id: group.id, orgUserId: user.organizationUserId }, null, + function () { + toastr.success(user.email + ' has been removed.', 'User Removed'); + $analytics.eventTrack('Removed User From Group'); + var index = $scope.users.indexOf(user); + if (index > -1) { + $scope.users.splice(index, 1); + } + }, function () { + toastr.error('Unable to remove user.', 'Error'); + }); }; $scope.close = function () { diff --git a/src/app/organization/organizationPeopleGroupsController.js b/src/app/organization/organizationPeopleGroupsController.js index 07cba512b0..25c9084218 100644 --- a/src/app/organization/organizationPeopleGroupsController.js +++ b/src/app/organization/organizationPeopleGroupsController.js @@ -32,8 +32,6 @@ } $scope.selectedGroups = selectedGroups; $scope.loading = false; - }, function (error) { - }); $scope.toggleGroupSelectionAll = function ($event) { diff --git a/src/app/services/apiService.js b/src/app/services/apiService.js index 3f3daf3fbe..074e4b7f1e 100644 --- a/src/app/services/apiService.js +++ b/src/app/services/apiService.js @@ -91,7 +91,8 @@ listUsers: { url: _apiUri + '/organizations/:orgId/groups/:id/users', method: 'GET', params: { id: '@id', orgId: '@orgId' } }, post: { method: 'POST', params: { orgId: '@orgId' } }, put: { method: 'POST', params: { id: '@id', orgId: '@orgId' } }, - del: { url: _apiUri + '/organizations/:orgId/groups/:id/delete', method: 'POST', params: { id: '@id', orgId: '@orgId' } } + del: { url: _apiUri + '/organizations/:orgId/groups/:id/delete', method: 'POST', params: { id: '@id', orgId: '@orgId' } }, + delUser: { url: _apiUri + '/organizations/:orgId/groups/:id/delete-user/:orgUserId', method: 'POST', params: { id: '@id', orgId: '@orgId', orgUserId: '@orgUserId' } } }); _service.accounts = $resource(_apiUri + '/accounts', {}, {