瀏覽代碼

Export checklists

Ghassen Rjab 8 年之前
父節點
當前提交
25ce99958c
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      models/export.js

+ 5 - 0
models/export.js

@@ -55,6 +55,10 @@ class Exporter {
     result.cards = Cards.find(byBoard, noBoardId).fetch();
     result.comments = CardComments.find(byBoard, noBoardId).fetch();
     result.activities = Activities.find(byBoard, noBoardId).fetch();
+    result.checklists = [];
+    result.cards.forEach((card) => {
+      result.checklists.push(...Checklists.find({ cardId: card._id }).fetch());
+    });
     // [Old] for attachments we only export IDs and absolute url to original doc
     // [New] Encode attachment to base64
     const getBase64Data = function(doc, callback) {
@@ -99,6 +103,7 @@ class Exporter {
     });
     result.comments.forEach((comment) => { users[comment.userId] = true; });
     result.activities.forEach((activity) => { users[activity.userId] = true; });
+    result.checklists.forEach((checklist) => { users[checklist.userId] = true; });
     const byUserIds = { _id: { $in: Object.getOwnPropertyNames(users) } };
     // we use whitelist to be sure we do not expose inadvertently
     // some secret fields that gets added to User later.