mirror of
https://github.com/wekan/wekan.git
synced 2026-03-13 17:06:13 +01:00
Copy Checklist only copied the checklist items at the first time, now always
This commit is contained in:
parent
b7819cad69
commit
13fecfae27
1 changed files with 5 additions and 5 deletions
|
|
@ -66,11 +66,11 @@ Checklists.attachSchema(
|
||||||
|
|
||||||
Checklists.helpers({
|
Checklists.helpers({
|
||||||
copy(newCardId) {
|
copy(newCardId) {
|
||||||
const oldChecklistId = this._id;
|
let copyObj = Object.assign({}, this);
|
||||||
this._id = null;
|
delete copyObj._id;
|
||||||
this.cardId = newCardId;
|
copyObj.cardId = newCardId;
|
||||||
const newChecklistId = Checklists.insert(this);
|
const newChecklistId = Checklists.insert(copyObj);
|
||||||
ChecklistItems.find({ checklistId: oldChecklistId }).forEach(function(
|
ChecklistItems.find({ checklistId: this._id }).forEach(function(
|
||||||
item,
|
item,
|
||||||
) {
|
) {
|
||||||
item._id = null;
|
item._id = null;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue