From a4e9251eb7a90ca50ccf4839b0c2e107840ec571 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 5 Feb 2022 17:13:02 -0800 Subject: [PATCH] fix: Images no longer in original document not included in export archive (#3063) closes #2578 --- server/utils/zip.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/utils/zip.ts b/server/utils/zip.ts index 473d495cc..1b81fdc4c 100644 --- a/server/utils/zip.ts +++ b/server/utils/zip.ts @@ -7,6 +7,7 @@ import Collection from "@server/models/Collection"; import Document from "@server/models/Document"; import { NavigationNode } from "~/types"; import { serializeFilename } from "./fs"; +import parseAttachmentIds from "./parseAttachmentIds"; import { getFileByKey } from "./s3"; async function addToArchive(zip: JSZip, documents: NavigationNode[]) { @@ -20,7 +21,8 @@ async function addToArchive(zip: JSZip, documents: NavigationNode[]) { let text = document.toMarkdown(); const attachments = await Attachment.findAll({ where: { - documentId: document.id, + teamId: document.teamId, + id: parseAttachmentIds(document.text), }, });