Merge pull request #3004 from slvrpdr/master

When adding a user to a board that has subtasks, also add user to the subtask board
This commit is contained in:
Lauri Ojansivu 2020-04-09 22:26:34 +03:00 committed by GitHub
commit c6afe8d007
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -814,6 +814,16 @@ if (Meteor.isServer) {
board.addMember(user._id);
user.addInvite(boardId);
//Check if there is a subtasks board
if (board.subtasksDefaultBoardId){
const subBoard = Boards.findOne(board.subtasksDefaultBoardId);
//If there is, also add user to that board
if (subBoard) {
subBoard.addMember(user._id);
user.addInvite(subBoard._id);
}
}
try {
const params = {
user: user.username,