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

@ -2,6 +2,7 @@
// non-archived boards:
// 1. that the user is a member of
// 2. the user has starred
import { ReactiveCache } from '/imports/reactiveCache';
import Users from "../../models/users";
import Org from "../../models/org";
import Team from "../../models/team";
@ -326,7 +327,7 @@ Meteor.methods({
check(boardId, String);
check(properties, Object);
const board = Boards.findOne(boardId);
const board = ReactiveCache.getBoard(boardId);
if (board) {
for (const key in properties) {
board[key] = properties[key];

View file

@ -1,10 +1,12 @@
import { ReactiveCache } from '/imports/reactiveCache';
Meteor.methods({
copySwimlane(swimlaneId, toBoardId) {
check(swimlaneId, String);
check(toBoardId, String);
const swimlane = Swimlanes.findOne(swimlaneId);
const toBoard = Boards.findOne(toBoardId);
const toBoard = ReactiveCache.getBoard(toBoardId);
if (swimlane && toBoard) {
swimlane.copy(toBoardId);
@ -19,7 +21,7 @@ Meteor.methods({
check(toBoardId, String);
const swimlane = Swimlanes.findOne(swimlaneId);
const toBoard = Boards.findOne(toBoardId);
const toBoard = ReactiveCache.getBoard(toBoardId);
if (swimlane && toBoard) {
swimlane.move(toBoardId);