mirror of
https://github.com/wekan/wekan.git
synced 2025-12-30 22:28:49 +01:00
Copy template attachments
This commit is contained in:
parent
da21a2a410
commit
abb7108321
1 changed files with 9 additions and 0 deletions
|
|
@ -287,6 +287,8 @@ Cards.helpers({
|
|||
}), '_id');
|
||||
|
||||
const oldId = this._id;
|
||||
const oldCard = Cards.findOne(oldId);
|
||||
|
||||
delete this._id;
|
||||
delete this.labelIds;
|
||||
this.labelIds= newCardLabels;
|
||||
|
|
@ -295,6 +297,13 @@ Cards.helpers({
|
|||
this.listId = listId;
|
||||
const _id = Cards.insert(this);
|
||||
|
||||
// Copy attachments
|
||||
oldCard.attachments().forEach((att) => {
|
||||
att.cardId = _id;
|
||||
delete att._id;
|
||||
return Attachments.insert(att);
|
||||
});
|
||||
|
||||
// copy checklists
|
||||
Checklists.find({cardId: oldId}).forEach((ch) => {
|
||||
// REMOVE verify copy with arguments
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue