fix: Handle document Id in document structure does not exist in db

closes #1938
This commit is contained in:
Tom Moor
2021-03-09 22:45:40 -08:00
parent e90c02bec7
commit f50b88716b

View File

@ -9,6 +9,9 @@ import { getFileByKey } from "./s3";
async function addToArchive(zip, documents) {
for (const doc of documents) {
const document = await Document.findByPk(doc.id);
if (!document) {
continue;
}
let text = document.toMarkdown();
const attachments = await Attachment.findAll({