mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Added "Move Checklist" to checklist menu action
This commit is contained in:
parent
395452b54f
commit
a66257ec21
5 changed files with 274 additions and 1 deletions
|
|
@ -147,6 +147,37 @@ Checklists.mutations({
|
|||
setTitle(title) {
|
||||
return { $set: { title } };
|
||||
},
|
||||
/** move the checklist to another card
|
||||
* @param newCardId move the checklist to this cardId
|
||||
*/
|
||||
move(newCardId) {
|
||||
// update every activity
|
||||
Activities.find(
|
||||
{checklistId: this._id}
|
||||
).forEach(activity => {
|
||||
Activities.update(activity._id, {
|
||||
$set: {
|
||||
cardId: newCardId,
|
||||
},
|
||||
});
|
||||
});
|
||||
// update every checklist-item
|
||||
ChecklistItems.find(
|
||||
{checklistId: this._id}
|
||||
).forEach(checklistItem => {
|
||||
ChecklistItems.update(checklistItem._id, {
|
||||
$set: {
|
||||
cardId: newCardId,
|
||||
},
|
||||
});
|
||||
});
|
||||
// update the checklist itself
|
||||
return {
|
||||
$set: {
|
||||
cardId: newCardId,
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
if (Meteor.isServer) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue