mirror of
https://github.com/wekan/wekan.git
synced 2025-12-24 03:10:12 +01:00
Move every Boards.findOne(boardId) to the ReactiveCache (Part 2)
This commit is contained in:
parent
9022e9949f
commit
a182482cfb
37 changed files with 166 additions and 127 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
import { ALLOWED_COLORS } from '/config/const';
|
||||
|
||||
Lists = new Mongo.Collection('lists');
|
||||
|
|
@ -175,13 +176,13 @@ Lists.attachSchema(
|
|||
|
||||
Lists.allow({
|
||||
insert(userId, doc) {
|
||||
return allowIsBoardMemberCommentOnly(userId, Boards.findOne(doc.boardId));
|
||||
return allowIsBoardMemberCommentOnly(userId, ReactiveCache.getBoard(doc.boardId));
|
||||
},
|
||||
update(userId, doc) {
|
||||
return allowIsBoardMemberCommentOnly(userId, Boards.findOne(doc.boardId));
|
||||
return allowIsBoardMemberCommentOnly(userId, ReactiveCache.getBoard(doc.boardId));
|
||||
},
|
||||
remove(userId, doc) {
|
||||
return allowIsBoardMemberCommentOnly(userId, Boards.findOne(doc.boardId));
|
||||
return allowIsBoardMemberCommentOnly(userId, ReactiveCache.getBoard(doc.boardId));
|
||||
},
|
||||
fetch: ['boardId'],
|
||||
});
|
||||
|
|
@ -269,7 +270,7 @@ Lists.helpers({
|
|||
},
|
||||
|
||||
board() {
|
||||
return Boards.findOne(this.boardId);
|
||||
return ReactiveCache.getBoard(this.boardId);
|
||||
},
|
||||
|
||||
getWipLimit(option) {
|
||||
|
|
@ -559,7 +560,7 @@ if (Meteor.isServer) {
|
|||
try {
|
||||
const paramBoardId = req.params.boardId;
|
||||
Authentication.checkBoardAccess(req.userId, paramBoardId);
|
||||
const board = Boards.findOne(paramBoardId);
|
||||
const board = ReactiveCache.getBoard(paramBoardId);
|
||||
const id = Lists.insert({
|
||||
title: req.body.title,
|
||||
boardId: paramBoardId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue