Fix invites

This commit is contained in:
Justin Reynolds 2019-07-18 13:06:25 -05:00
parent 34bd1e9c49
commit 66b45ed35c
2 changed files with 15 additions and 2 deletions

View file

@ -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({