fix: Images no longer in original document not included in export archive (#3063)
closes #2578
This commit is contained in:
@@ -7,6 +7,7 @@ import Collection from "@server/models/Collection";
|
|||||||
import Document from "@server/models/Document";
|
import Document from "@server/models/Document";
|
||||||
import { NavigationNode } from "~/types";
|
import { NavigationNode } from "~/types";
|
||||||
import { serializeFilename } from "./fs";
|
import { serializeFilename } from "./fs";
|
||||||
|
import parseAttachmentIds from "./parseAttachmentIds";
|
||||||
import { getFileByKey } from "./s3";
|
import { getFileByKey } from "./s3";
|
||||||
|
|
||||||
async function addToArchive(zip: JSZip, documents: NavigationNode[]) {
|
async function addToArchive(zip: JSZip, documents: NavigationNode[]) {
|
||||||
@@ -20,7 +21,8 @@ async function addToArchive(zip: JSZip, documents: NavigationNode[]) {
|
|||||||
let text = document.toMarkdown();
|
let text = document.toMarkdown();
|
||||||
const attachments = await Attachment.findAll({
|
const attachments = await Attachment.findAll({
|
||||||
where: {
|
where: {
|
||||||
documentId: document.id,
|
teamId: document.teamId,
|
||||||
|
id: parseAttachmentIds(document.text),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user