From 89c4778b992093f4117155c6ff6a205e87fbe4b9 Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Thu, 30 Apr 2020 16:41:48 +0200 Subject: [PATCH] #1253 Specify user organisation when deleting a user. --- .../app/scripts/components/organisation/OrgUserListCmp.js | 4 ++-- frontend/app/scripts/services/api/UserSrv.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) 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); })