diff options
author | Andrés Manelli <andresmanelli@gmail.com> | 2019-02-27 20:45:58 +0100 |
---|---|---|
committer | Andrés Manelli <andresmanelli@gmail.com> | 2019-02-27 21:50:08 +0100 |
commit | da21a2a410c9b905de89d66236748e0c8f5357ea (patch) | |
tree | 631efc1954e7be787576284ea55321dd7c424d97 /models/lists.js | |
parent | 904b5bf0f5f6e36131bf2d081a5d08fef408ac81 (diff) | |
download | wekan-da21a2a410c9b905de89d66236748e0c8f5357ea.tar.gz wekan-da21a2a410c9b905de89d66236748e0c8f5357ea.tar.bz2 wekan-da21a2a410c9b905de89d66236748e0c8f5357ea.zip |
Standarize copy functions. Match labels by name
Diffstat (limited to 'models/lists.js')
-rw-r--r-- | models/lists.js | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/models/lists.js b/models/lists.js index d76c961c..a8e597ee 100644 --- a/models/lists.js +++ b/models/lists.js @@ -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); }); }, |