Move every Boards.findOne(boardId) to the ReactiveCache (Part 2)

This commit is contained in:
Martin Filser 2023-01-14 13:29:57 +01:00
parent 9022e9949f
commit a182482cfb
37 changed files with 166 additions and 127 deletions

View file

@ -1,3 +1,5 @@
import { ReactiveCache } from '/imports/reactiveCache';
const commentReactionSchema = new SimpleSchema({
reactionCodepoint: {
type: String,
@ -49,13 +51,13 @@ CardCommentReactions.attachSchema(
CardCommentReactions.allow({
insert(userId, doc) {
return allowIsBoardMember(userId, Boards.findOne(doc.boardId));
return allowIsBoardMember(userId, ReactiveCache.getBoard(doc.boardId));
},
update(userId, doc) {
return allowIsBoardMember(userId, Boards.findOne(doc.boardId));
return allowIsBoardMember(userId, ReactiveCache.getBoard(doc.boardId));
},
remove(userId, doc) {
return allowIsBoardMember(userId, Boards.findOne(doc.boardId));
return allowIsBoardMember(userId, ReactiveCache.getBoard(doc.boardId));
},
fetch: ['boardId'],
});