Move every CardComments.find(idOrFirstObjectSelector, options) to the ReactiveCache (directory server/)

This commit is contained in:
Martin Filser 2023-03-12 18:28:39 +01:00
parent 7caf817c81
commit d6ca13a61d
2 changed files with 11 additions and 7 deletions

View file

@ -794,7 +794,7 @@ function findCards(sessionId, query) {
ReactiveCache.getChecklists({ cardId: { $in: cards.map(c => c._id) } }, {}, true), ReactiveCache.getChecklists({ cardId: { $in: cards.map(c => c._id) } }, {}, true),
ReactiveCache.getChecklistItems({ cardId: { $in: cards.map(c => c._id) } }, {}, true), ReactiveCache.getChecklistItems({ cardId: { $in: cards.map(c => c._id) } }, {}, true),
Attachments.find({ 'meta.cardId': { $in: cards.map(c => c._id) } }).cursor, Attachments.find({ 'meta.cardId': { $in: cards.map(c => c._id) } }).cursor,
CardComments.find({ cardId: { $in: cards.map(c => c._id) } }), ReactiveCache.getCardComments({ cardId: { $in: cards.map(c => c._id) } }, {}, true),
SessionData.find({ userId, sessionId }), SessionData.find({ userId, sessionId }),
]; ];
} }

View file

@ -70,13 +70,17 @@ Meteor.publish('notificationChecklists', function() {
// gets all comments associated with activities associated with the current user // gets all comments associated with activities associated with the current user
Meteor.publish('notificationComments', function() { Meteor.publish('notificationComments', function() {
const ret = CardComments.find({ const ret = ReactiveCache.getCardComments(
{
_id: { _id: {
$in: activities() $in: activities()
.map(v => v.commentId) .map(v => v.commentId)
.filter(v => !!v), .filter(v => !!v),
}, },
}); },
{},
true,
);
return ret; return ret;
}); });