浏览代码

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

Martin Filser 2 年之前
父节点
当前提交
d6ca13a61d
共有 2 个文件被更改,包括 11 次插入7 次删除
  1. 1 1
      server/publications/cards.js
  2. 10 6
      server/publications/notifications.js

+ 1 - 1
server/publications/cards.js

@@ -794,7 +794,7 @@ function findCards(sessionId, query) {
       ReactiveCache.getChecklists({ 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,
-      CardComments.find({ cardId: { $in: cards.map(c => c._id) } }),
+      ReactiveCache.getCardComments({ cardId: { $in: cards.map(c => c._id) } }, {}, true),
       SessionData.find({ userId, sessionId }),
     ];
   }

+ 10 - 6
server/publications/notifications.js

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