summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorZeBBy <2991266+zebby76@users.noreply.github.com>2018-04-27 15:29:31 +0200
committerGitHub <noreply@github.com>2018-04-27 15:29:31 +0200
commite721dba1e27aa91af1fc61f707ad0f5301bd5d39 (patch)
tree787380f3abc7eb6d34ae7b690d9078777662675c /models
parent3b6ec34bf504ebfc7e83416ec1a67ce37ecf907d (diff)
downloadwekan-e721dba1e27aa91af1fc61f707ad0f5301bd5d39.tar.gz
wekan-e721dba1e27aa91af1fc61f707ad0f5301bd5d39.tar.bz2
wekan-e721dba1e27aa91af1fc61f707ad0f5301bd5d39.zip
Fix Trello importation for ChecklistItems
Diffstat (limited to 'models')
-rw-r--r--models/trelloCreator.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/models/trelloCreator.js b/models/trelloCreator.js
index 89e48a16..72af1f84 100644
--- a/models/trelloCreator.js
+++ b/models/trelloCreator.js
@@ -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}});
}
});
}