Jelajahi Sumber

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

Martin Filser 2 tahun lalu
induk
melakukan
46840c9373

+ 1 - 1
server/publications/boards.js

@@ -221,7 +221,7 @@ Meteor.publishRelations('board', function(boardId, isArchived) {
     ),
     function(boardId, board) {
       this.cursor(ReactiveCache.getLists({ boardId, archived: isArchived }, {}, true));
-      this.cursor(Swimlanes.find({ boardId, archived: isArchived }));
+      this.cursor(ReactiveCache.getSwimlanes({ boardId, archived: isArchived }, {}, true));
       this.cursor(Integrations.find({ boardId }));
       this.cursor(CardCommentReactions.find({ boardId }));
       this.cursor(

+ 2 - 1
server/publications/cards.js

@@ -783,9 +783,10 @@ function findCards(sessionId, query) {
         { fields: { ...fields, labels: 1, color: 1 } },
         true,
       ),
-      Swimlanes.find(
+      ReactiveCache.getSwimlanes(
         { _id: { $in: swimlanes } },
         { fields: { ...fields, color: 1 } },
+        true,
       ),
       ReactiveCache.getLists({ _id: { $in: lists } }, { fields }, true),
       CustomFields.find({ _id: { $in: customFieldIds } }),

+ 10 - 6
server/publications/notifications.js

@@ -90,13 +90,17 @@ Meteor.publish('notificationLists', function() {
 
 // gets all swimlanes associated with activities associated with the current user
 Meteor.publish('notificationSwimlanes', function() {
-  const ret = Swimlanes.find({
-    _id: {
-      $in: activities()
-        .map(v => v.swimlaneId)
-        .filter(v => !!v),
+  const ret = ReactiveCache.getSwimlanes(
+    {
+      _id: {
+        $in: activities()
+          .map(v => v.swimlaneId)
+          .filter(v => !!v),
+      },
     },
-  });
+    {},
+    true,
+  );
   return ret;
 });