diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2018-11-09 16:00:21 +0100 |
---|---|---|
committer | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2019-01-18 17:01:03 +0100 |
commit | 889aa6d65208db2f3f364cc37a29be9325fa186a (patch) | |
tree | 85cd73f9e26ff40eed7e9ecfb3947d89a8d0cb07 /models/boards.js | |
parent | 78e04578436b54e2d47c89b9f82e8dcc96f6daf9 (diff) | |
download | wekan-889aa6d65208db2f3f364cc37a29be9325fa186a.tar.gz wekan-889aa6d65208db2f3f364cc37a29be9325fa186a.tar.bz2 wekan-889aa6d65208db2f3f364cc37a29be9325fa186a.zip |
Revert "models: boards: add PUT members entry point"
This reverts commit f61942e5cb672d3e0fd4df6c5ff9b3f15f7cb778.
Adding a member is actually already handled by
POST', '/api/boards/:boardId/members/:userId/add'
So this function is purely duplicated.
Not to mention that the '/add' one allows to set permissions
so this one in this commit is less interesting.
Diffstat (limited to 'models/boards.js')
-rw-r--r-- | models/boards.js | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/models/boards.js b/models/boards.js index 57f3a1f1..db3b1149 100644 --- a/models/boards.js +++ b/models/boards.js @@ -278,10 +278,6 @@ Boards.helpers({ return Users.find({ _id: { $in: _.pluck(this.members, 'userId') } }); }, - getMember(id) { - return _.findWhere(this.members, { userId: id }); - }, - getLabel(name, color) { return _.findWhere(this.labels, { name, color }); }, @@ -847,34 +843,6 @@ if (Meteor.isServer) { } }); - JsonRoutes.add('PUT', '/api/boards/:boardId/members', function (req, res) { - Authentication.checkUserId(req.userId); - try { - const boardId = req.params.boardId; - const board = Boards.findOne({ _id: boardId }); - const userId = req.body.userId; - const user = Users.findOne({ _id: userId }); - - if (!board.getMember(userId)) { - user.addInvite(boardId); - board.addMember(userId); - JsonRoutes.sendResult(res, { - code: 200, - data: id, - }); - } else { - JsonRoutes.sendResult(res, { - code: 200, - }); - } - } - catch (error) { - JsonRoutes.sendResult(res, { - data: error, - }); - } - }); - JsonRoutes.add('POST', '/api/boards', function (req, res) { try { Authentication.checkUserId(req.userId); |