summaryrefslogtreecommitdiffstats
path: root/models/boards.js
diff options
context:
space:
mode:
Diffstat (limited to 'models/boards.js')
-rw-r--r--models/boards.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/models/boards.js b/models/boards.js
index 2346ecb6..2117ff7c 100644
--- a/models/boards.js
+++ b/models/boards.js
@@ -952,6 +952,19 @@ if (Meteor.isServer) {
} else throw new Meteor.Error('error-board-notAMember');
} else throw new Meteor.Error('error-board-doesNotExist');
},
+ acceptInvite(boardId) {
+ check(boardId, String);
+ const board = Boards.findOne(boardId);
+ if (!board) {
+ throw new Meteor.Error('error-board-doesNotExist');
+ }
+
+ Meteor.users.update(Meteor.userId(), {
+ $pull: {
+ 'profile.invitedBoards': boardId,
+ },
+ });
+ },
});
Meteor.methods({