mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
19 lines
605 B
JavaScript
19 lines
605 B
JavaScript
// We use activities fields at two different places:
|
|
// 1. The board sidebar
|
|
// 2. The card activity tab
|
|
// We use this publication to paginate for these two publications.
|
|
|
|
Meteor.publish('activities', (kind, id, limit, hideSystem) => {
|
|
check(kind, Match.Where((x) => {
|
|
return ['board', 'card'].indexOf(x) !== -1;
|
|
}));
|
|
check(id, String);
|
|
check(limit, Number);
|
|
check(hideSystem, Boolean);
|
|
|
|
const selector = (hideSystem) ? {$and: [{activityType: 'addComment'}, {[`${kind}Id`]: id}]} : {[`${kind}Id`]: id};
|
|
return Activities.find(selector, {
|
|
limit,
|
|
sort: {createdAt: -1},
|
|
});
|
|
});
|