mirror of
https://github.com/wekan/wekan.git
synced 2025-04-23 13:37:09 -04:00
Move every Activities.find(idOrFirstObjectSelector, options) to the ReactiveCache (directory server/)
This commit is contained in:
parent
286617e7be
commit
7caf817c81
2 changed files with 15 additions and 8 deletions
|
@ -33,9 +33,12 @@ Meteor.publish('activities', (kind, id, limit, hideSystem) => {
|
|||
const selector = hideSystem
|
||||
? { $and: [{ activityType: 'addComment' }, { [`${kind}Id`]: { $in: linkedElmtId } }] }
|
||||
: { [`${kind}Id`]: { $in: linkedElmtId } };
|
||||
const ret = Activities.find(selector, {
|
||||
limit,
|
||||
sort: { createdAt: -1 },
|
||||
});
|
||||
const ret = ReactiveCache.getActivities(selector,
|
||||
{
|
||||
limit,
|
||||
sort: { createdAt: -1 },
|
||||
},
|
||||
true,
|
||||
);
|
||||
return ret;
|
||||
});
|
||||
|
|
|
@ -132,9 +132,13 @@ function activities() {
|
|||
const activityIds = ReactiveCache.getCurrentUser()?.profile?.notifications?.map(v => v.activity) || [];
|
||||
let ret = [];
|
||||
if (activityIds.length > 0) {
|
||||
ret = Activities.find({
|
||||
_id: { $in: activityIds },
|
||||
});
|
||||
return ret;
|
||||
ret = ReactiveCache.getActivities(
|
||||
{
|
||||
_id: { $in: activityIds },
|
||||
},
|
||||
{},
|
||||
true,
|
||||
);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue