diff options
author | Maxime Quandalle <maxime@quandalle.com> | 2015-12-21 17:54:21 +0100 |
---|---|---|
committer | Maxime Quandalle <maxime@quandalle.com> | 2015-12-21 17:54:21 +0100 |
commit | 8a47cfa4ba3a4728ead345256ef822ea36924d96 (patch) | |
tree | b9c306f409468bbad90cbfd1987eb2be950de76e /client/components/sidebar | |
parent | 2cb6195591153dc6b6c2c62a8df7aab90eb012b7 (diff) | |
download | wekan-8a47cfa4ba3a4728ead345256ef822ea36924d96.tar.gz wekan-8a47cfa4ba3a4728ead345256ef822ea36924d96.tar.bz2 wekan-8a47cfa4ba3a4728ead345256ef822ea36924d96.zip |
Unassign members before removing them from a board
Closes #399
Diffstat (limited to 'client/components/sidebar')
-rw-r--r-- | client/components/sidebar/sidebar.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js index 4bb53d4d..35651622 100644 --- a/client/components/sidebar/sidebar.js +++ b/client/components/sidebar/sidebar.js @@ -131,9 +131,12 @@ Template.memberPopup.events({ }, 'click .js-change-role': Popup.open('changePermissions'), 'click .js-remove-member': Popup.afterConfirm('removeMember', function() { - const currentBoard = Boards.findOne(Session.get('currentBoard')); + const boardId = Session.get('currentBoard'); const memberId = this.userId; - currentBoard.removeMember(memberId); + Cards.find({ boardId, members: memberId }).forEach((card) => { + card.unassignMember(memberId); + }); + Boards.findOne(boardId).removeMember(memberId); Popup.close(); }), 'click .js-leave-member'() { |