summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-05-10 20:50:53 +0300
committerLauri Ojansivu <x@xet7.org>2019-05-10 20:50:53 +0300
commit828f6ea321020eda77fea399df52889e2081dfac (patch)
tree94f0370da15ceb0022f618469c015fc8c76b80fc /models
parent7ff4067e88ed59686c86d81447fa2ce550032034 (diff)
downloadwekan-828f6ea321020eda77fea399df52889e2081dfac.tar.gz
wekan-828f6ea321020eda77fea399df52889e2081dfac.tar.bz2
wekan-828f6ea321020eda77fea399df52889e2081dfac.zip
- Add Feature: Move board to Archive button at each board at All Boards page.
Thanks to xet7 ! Related #2389
Diffstat (limited to 'models')
-rw-r--r--models/boards.js16
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) {