diff --git a/frontend/app/scripts/components/organisation/OrgUserListCmp.js b/frontend/app/scripts/components/organisation/OrgUserListCmp.js index d4187d35df..ec8cefce55 100644 --- a/frontend/app/scripts/components/organisation/OrgUserListCmp.js +++ b/frontend/app/scripts/components/organisation/OrgUserListCmp.js @@ -3,7 +3,7 @@ angular.module('theHiveComponents') .component('orgUserList', { - controller: function($scope, UserSrv, NotificationSrv, ModalSrv, AuthenticationSrv, clipboard) { + controller: function($scope, $stateParams, UserSrv, NotificationSrv, ModalSrv, AuthenticationSrv, clipboard) { var self = this; self.userKeyCache = {}; @@ -157,7 +157,7 @@ modalInstance.result .then(function(/*response*/) { - return UserSrv.remove(user._id); + return UserSrv.remove(user._id, $stateParams.organisation); }) .then(function() { NotificationSrv.success('User ' + user.login + ' has been successfully removed.'); diff --git a/frontend/app/scripts/services/api/UserSrv.js b/frontend/app/scripts/services/api/UserSrv.js index a1d30666d8..3764a46cb6 100644 --- a/frontend/app/scripts/services/api/UserSrv.js +++ b/frontend/app/scripts/services/api/UserSrv.js @@ -57,9 +57,11 @@ return defer.promise; }; - this.remove = function(id) { + this.remove = function(id, organisation) { return $http - .delete('./api/v1/user/' + id + '/force') + .delete('./api/v1/user/' + id + '/force', { + params: {organisation: organisation} + }) .then(function(response) { return $q.resolve(response.data); })