From 6ced47aa8c7c62764778f8123708455c0f33f82f Mon Sep 17 00:00:00 2001 From: Pedro Sousa <18445484+slvrpdr@users.noreply.github.com> Date: Thu, 9 Apr 2020 19:10:50 +0100 Subject: When adding a user to a board that has subtasks, also add user to the subtask board --- models/users.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'models') diff --git a/models/users.js b/models/users.js index 8a05a0d2..b1f3e26c 100644 --- a/models/users.js +++ b/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, -- cgit v1.2.3-1-g7c22