From 5eb4eb04c4571f5bac9101db261b0cb9cba18980 Mon Sep 17 00:00:00 2001 From: Martin Filser Date: Sun, 26 Feb 2023 11:25:30 +0100 Subject: [PATCH] Move every Attachments.find(idOrFirstObjectSelector, options) to the ReactiveCache (directory server/) --- server/publications/cards.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/publications/cards.js b/server/publications/cards.js index 1d83298b2..4d0e66ccc 100644 --- a/server/publications/cards.js +++ b/server/publications/cards.js @@ -427,7 +427,7 @@ function buildSelector(queryParams) { case PREDICATE_ATTACHMENT: selector.$and.push({ _id: { - $in: Attachments.find({}, { fields: { cardId: 1 } }).map( + $in: ReactiveCache.getAttachments({}, { fields: { cardId: 1 } }).map( a => a.cardId, ), }, @@ -481,7 +481,7 @@ function buildSelector(queryParams) { { fields: { cardId: 1 } }, ); - const attachments = Attachments.find({ 'original.name': regex }); + const attachments = ReactiveCache.getAttachments({ 'original.name': regex }); const comments = ReactiveCache.getCardComments( { text: regex },