mirror of
https://github.com/wekan/wekan.git
synced 2025-04-20 12:07:11 -04:00
Fix Trello importation for ChecklistItems
This commit is contained in:
parent
3b6ec34bf5
commit
e721dba1e2
1 changed files with 10 additions and 6 deletions
|
@ -429,17 +429,21 @@ export class TrelloCreator {
|
|||
const checklistId = Checklists.direct.insert(checklistToCreate);
|
||||
// keep track of Trello id => WeKan id
|
||||
this.checklists[checklist.id] = checklistId;
|
||||
// Now add the items to the checklist
|
||||
// Now add the items to the checklistItems
|
||||
var counter = 0;
|
||||
const itemsToCreate = [];
|
||||
checklist.checkItems.forEach((item) => {
|
||||
itemsToCreate.push({
|
||||
_id: checklistId + itemsToCreate.length,
|
||||
counter++;
|
||||
const checklistItemTocreate = {
|
||||
_id: checklistId + counter,
|
||||
title: item.name,
|
||||
isFinished: item.state === 'complete',
|
||||
checklistId: this.checklists[checklist.id],
|
||||
cardId: this.cards[checklist.idCard],
|
||||
sort: item.pos,
|
||||
});
|
||||
isFinished: item.state === 'complete',
|
||||
};
|
||||
ChecklistItems.direct.insert(checklistItemTocreate);
|
||||
});
|
||||
Checklists.direct.update(checklistId, {$set: {items: itemsToCreate}});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue