Skip to content

Commit

Permalink
#1253 Specify user organisation when deleting a user.
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Apr 30, 2020
1 parent 3fbed45 commit 89c4778
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down Expand Up @@ -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.');
Expand Down
6 changes: 4 additions & 2 deletions frontend/app/scripts/services/api/UserSrv.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
})
Expand Down

0 comments on commit 89c4778

Please sign in to comment.