- Add Feature: Move board to Archive button at each board at All Boards page.

Thanks to xet7 !

Related #2389
This commit is contained in:
Lauri Ojansivu 2019-05-10 20:50:53 +03:00
parent 7ff4067e88
commit 828f6ea321
4 changed files with 38 additions and 2 deletions

View file

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