mirror of
https://github.com/wekan/wekan.git
synced 2026-01-27 11:46:10 +01:00
Standarize copy functions. Match labels by name
This commit is contained in:
parent
904b5bf0f5
commit
da21a2a410
4 changed files with 36 additions and 20 deletions
|
|
@ -137,12 +137,15 @@ Lists.allow({
|
|||
});
|
||||
|
||||
Lists.helpers({
|
||||
copy(swimlaneId) {
|
||||
copy(boardId, swimlaneId) {
|
||||
const oldId = this._id;
|
||||
const oldSwimlaneId = this.swimlaneId || null;
|
||||
this.boardId = boardId;
|
||||
this.swimlaneId = swimlaneId;
|
||||
|
||||
let _id = null;
|
||||
existingListWithSameName = Lists.findOne({
|
||||
boardId: this.boardId,
|
||||
boardId,
|
||||
title: this.title,
|
||||
archived: false,
|
||||
});
|
||||
|
|
@ -160,11 +163,7 @@ Lists.helpers({
|
|||
listId: oldId,
|
||||
archived: false,
|
||||
}).forEach((card) => {
|
||||
card.type = 'cardType-card';
|
||||
card.listId = _id;
|
||||
card.boardId = this.boardId;
|
||||
card.swimlaneId = swimlaneId;
|
||||
card.copy();
|
||||
card.copy(boardId, swimlaneId, _id);
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue