diff options
author | Lauri Ojansivu <x@xet7.org> | 2019-05-10 21:03:03 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2019-05-10 21:03:03 +0300 |
commit | ac0f13ad1891d576ba5bf662daaab7676a8fc74f (patch) | |
tree | bf426e2d761228b7cc76f4d305608da93240f49f /models/boards.js | |
parent | 34b1654077c791e583c9d9dbbc4e73c910b7d373 (diff) | |
parent | ab4dab2ade0577d4eb344f8b940e3b8ccafbe626 (diff) | |
download | wekan-ac0f13ad1891d576ba5bf662daaab7676a8fc74f.tar.gz wekan-ac0f13ad1891d576ba5bf662daaab7676a8fc74f.tar.bz2 wekan-ac0f13ad1891d576ba5bf662daaab7676a8fc74f.zip |
Merge branch 'edge' into meteor-1.8
Diffstat (limited to 'models/boards.js')
-rw-r--r-- | models/boards.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/models/boards.js b/models/boards.js index b07d9e27..396d90fb 100644 --- a/models/boards.js +++ b/models/boards.js @@ -867,6 +867,22 @@ if (Meteor.isServer) { } else throw new Meteor.Error('error-board-doesNotExist'); }, }); + + Meteor.methods({ + archiveBoard(boardId) { + check(boardId, String); + const board = Boards.findOne(boardId); + if (board) { + const userId = Meteor.userId(); + const index = board.memberIndex(userId); + if (index >= 0) { + board.archive(); + return true; + } else throw new Meteor.Error('error-board-notAMember'); + } else throw new Meteor.Error('error-board-doesNotExist'); + }, + }); + } if (Meteor.isServer) { |