When adding a user to a board that has subtasks, also add user to the subtask board

pull/3004/head
Pedro Sousa 5 years ago
parent 121686a928
commit 6ced47aa8c
  1. 10
      models/users.js

@ -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,

Loading…
Cancel
Save