From 92733b24d1cc105ea6c57b3083e4671f61734b3d Mon Sep 17 00:00:00 2001 From: Martin Filser Date: Sat, 4 Feb 2023 17:11:56 +0100 Subject: [PATCH] Move every CardComments.findOne(idOrFirstObjectSelector, options) to the ReactiveCache --- models/cardComments.js | 4 ++-- server/notifications/outgoing.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/models/cardComments.js b/models/cardComments.js index b93f6dea5..e61b5ae5c 100644 --- a/models/cardComments.js +++ b/models/cardComments.js @@ -285,7 +285,7 @@ if (Meteor.isServer) { Authentication.checkBoardAccess(req.userId, paramBoardId); JsonRoutes.sendResult(res, { code: 200, - data: CardComments.findOne({ + data: ReactiveCache.getCardComment({ _id: paramCommentId, cardId: paramCardId, boardId: paramBoardId, @@ -332,7 +332,7 @@ if (Meteor.isServer) { }, }); - const cardComment = CardComments.findOne({ + const cardComment = ReactiveCache.getCardComment({ _id: id, cardId: paramCardId, boardId: paramBoardId, diff --git a/server/notifications/outgoing.js b/server/notifications/outgoing.js index 3e7b249e6..4dc66492a 100644 --- a/server/notifications/outgoing.js +++ b/server/notifications/outgoing.js @@ -75,7 +75,7 @@ if (Meteor.isServer) { const newComment = data.comment; if (paramCardId && paramBoardId && newComment) { // only process data with the cardid, boardid and comment text, TODO can expand other functions here to react on returned data - const comment = CardComments.findOne({ + const comment = ReactiveCache.getCardComment({ _id: paramCommentId, cardId: paramCardId, boardId: paramBoardId,