Fix bug in call to get default swimlane

This commit is contained in:
John R. Supplee 2021-03-27 19:02:07 +02:00
parent ed54c09b48
commit 36a4740429

View file

@ -4,19 +4,20 @@ Meteor.methods({
check(toBoardId, String);
const swimlane = Swimlanes.findOne(swimlaneId);
const board = Boards.findOne(toBoardId);
const fromBoard = Boards.findOne(swimlane.boardId);
const toBoard = Boards.findOne(toBoardId);
if (swimlane && board) {
if (swimlane && toBoard) {
swimlane.lists().forEach(list => {
const boardList = Lists.findOne({
const toList = Lists.findOne({
boardId: toBoardId,
title: list.title,
archived: false,
});
let toListId;
if (boardList) {
toListId = boardList._id;
if (toList) {
toListId = toList._id;
} else {
toListId = Lists.insert({
title: list.title,
@ -42,7 +43,7 @@ Meteor.methods({
});
// make sure there is a default swimlane
this.board().getDefaultSwimline();
fromBoard.getDefaultSwimline();
return true;
}