mirror of
https://github.com/wekan/wekan.git
synced 2025-12-18 00:10:13 +01: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
|
const selector = hideSystem
|
||||||
? { $and: [{ activityType: 'addComment' }, { [`${kind}Id`]: { $in: linkedElmtId } }] }
|
? { $and: [{ activityType: 'addComment' }, { [`${kind}Id`]: { $in: linkedElmtId } }] }
|
||||||
: { [`${kind}Id`]: { $in: linkedElmtId } };
|
: { [`${kind}Id`]: { $in: linkedElmtId } };
|
||||||
const ret = Activities.find(selector, {
|
const ret = ReactiveCache.getActivities(selector,
|
||||||
limit,
|
{
|
||||||
sort: { createdAt: -1 },
|
limit,
|
||||||
});
|
sort: { createdAt: -1 },
|
||||||
|
},
|
||||||
|
true,
|
||||||
|
);
|
||||||
return ret;
|
return ret;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -132,9 +132,13 @@ function activities() {
|
||||||
const activityIds = ReactiveCache.getCurrentUser()?.profile?.notifications?.map(v => v.activity) || [];
|
const activityIds = ReactiveCache.getCurrentUser()?.profile?.notifications?.map(v => v.activity) || [];
|
||||||
let ret = [];
|
let ret = [];
|
||||||
if (activityIds.length > 0) {
|
if (activityIds.length > 0) {
|
||||||
ret = Activities.find({
|
ret = ReactiveCache.getActivities(
|
||||||
_id: { $in: activityIds },
|
{
|
||||||
});
|
_id: { $in: activityIds },
|
||||||
return ret;
|
},
|
||||||
|
{},
|
||||||
|
true,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue