mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 07:50:12 +01:00
25 lines
585 B
JavaScript
25 lines
585 B
JavaScript
|
|
// We use activities fields at three different places:
|
||
|
|
// 1. The home page that contains
|
||
|
|
// 2. The board
|
||
|
|
// 3.
|
||
|
|
// We use publish paginate for these three publications.
|
||
|
|
|
||
|
|
Meteor.publish('activities', function(mode, id, limit) {
|
||
|
|
check(mode, Match.Where(function(x) {
|
||
|
|
return ['board', 'card'].indexOf(x) !== -1;
|
||
|
|
}));
|
||
|
|
check(id, String);
|
||
|
|
check(limit, Number);
|
||
|
|
|
||
|
|
var selector = {};
|
||
|
|
if (mode === 'board')
|
||
|
|
selector.boardId = id;
|
||
|
|
else if (mode === 'card')
|
||
|
|
selector.cardId = id;
|
||
|
|
|
||
|
|
return Activities.find(selector, {
|
||
|
|
sort: {createdAt: -1},
|
||
|
|
limit: limit
|
||
|
|
});
|
||
|
|
});
|