Move every Cards.findOne() to the ReactiveCache

This commit is contained in:
Martin Filser 2022-12-16 16:36:47 +01:00
parent a182482cfb
commit 3b65113d05
24 changed files with 96 additions and 87 deletions

View file

@ -81,7 +81,7 @@ if (Meteor.isServer) {
boardId: paramBoardId,
});
const board = ReactiveCache.getBoard(paramBoardId);
const card = Cards.findOne(paramCardId);
const card = ReactiveCache.getCard(paramCardId);
if (board && card) {
if (comment) {
Lock.set(comment._id, newComment);

View file

@ -19,7 +19,7 @@ Meteor.methods({
if (!watchableObj) throw new Meteor.Error('error-list-doesNotExist');
board = watchableObj.board();
} else if (watchableType === 'card') {
watchableObj = Cards.findOne(id);
watchableObj = ReactiveCache.getCard(id);
if (!watchableObj) throw new Meteor.Error('error-card-doesNotExist');
board = watchableObj.board();
} else {

View file

@ -1,4 +1,4 @@
//var nodemailer = require('nodemailer');
import { ReactiveCache } from '/imports/reactiveCache';
RulesHelper = {
executeRules(activity) {
@ -58,7 +58,7 @@ RulesHelper = {
return matchingMap;
},
performAction(activity, action) {
const card = Cards.findOne({ _id: activity.cardId });
const card = ReactiveCache.getCard(activity.cardId);
const boardId = activity.boardId;
if (
action.actionType === 'moveCardToTop' ||
@ -376,7 +376,7 @@ RulesHelper = {
}
if (action.actionType === 'linkCard') {
const list = Lists.findOne({ title: action.listName, boardId: action.boardId });
const card = Cards.findOne({ _id: activity.cardId });
const card = ReactiveCache.getCard(activity.cardId);
let listId = '';
let swimlaneId = '';
const swimlane = Swimlanes.findOne({