Implement board archive and restoration

This commit is contained in:
Maxime Quandalle 2015-08-23 11:09:48 +02:00
parent 9faaf07e02
commit 48ac8b026f
32 changed files with 138 additions and 42 deletions

View file

@ -22,6 +22,7 @@ Meteor.publish('boards', function() {
}, {
fields: {
_id: 1,
archived: 1,
slug: 1,
title: 1,
color: 1,
@ -30,6 +31,28 @@ Meteor.publish('boards', function() {
});
});
Meteor.publish('archivedBoards', function() {
if (! Match.test(this.userId, String))
return [];
return Boards.find({
archived: true,
members: {
$elemMatch: {
userId: this.userId,
isAdmin: true
}
}
}, {
fields: {
_id: 1,
archived: 1,
slug: 1,
title: 1
}
})
});
Meteor.publishComposite('board', function(boardId) {
check(boardId, String);
return {