wekan/server/publications/swimlanes.js

37 lines
818 B
JavaScript
Raw Normal View History

import { ReactiveCache } from '/imports/reactiveCache';
Meteor.methods({
async copySwimlane(swimlaneId, toBoardId) {
2021-04-22 14:05:20 +02:00
check(swimlaneId, String);
check(toBoardId, String);
const swimlane = await ReactiveCache.getSwimlane(swimlaneId);
const toBoard = await ReactiveCache.getBoard(toBoardId);
2021-04-22 14:05:20 +02:00
let ret = false;
2021-04-22 14:05:20 +02:00
if (swimlane && toBoard) {
swimlane.copy(toBoardId);
ret = true;
2021-04-22 14:05:20 +02:00
}
return ret;
2021-04-22 14:05:20 +02:00
},
async moveSwimlane(swimlaneId, toBoardId) {
check(swimlaneId, String);
check(toBoardId, String);
const swimlane = await ReactiveCache.getSwimlane(swimlaneId);
const toBoard = await ReactiveCache.getBoard(toBoardId);
let ret = false;
if (swimlane && toBoard) {
await swimlane.move(toBoardId);
ret = true;
}
return ret;
},
});