JSON to client (#5553)
This commit is contained in:
@@ -2,9 +2,10 @@ import uniq from "lodash/uniq";
|
||||
import { Op, QueryTypes } from "sequelize";
|
||||
import Logger from "@server/logging/Logger";
|
||||
import { Document, Attachment } from "@server/models";
|
||||
import { DocumentHelper } from "@server/models/helpers/DocumentHelper";
|
||||
import { ProsemirrorHelper } from "@server/models/helpers/ProsemirrorHelper";
|
||||
import DeleteAttachmentTask from "@server/queues/tasks/DeleteAttachmentTask";
|
||||
import { sequelize } from "@server/storage/database";
|
||||
import parseAttachmentIds from "@server/utils/parseAttachmentIds";
|
||||
|
||||
export default async function documentPermanentDeleter(documents: Document[]) {
|
||||
const activeDocument = documents.find((doc) => !doc.deletedAt);
|
||||
@@ -25,7 +26,9 @@ export default async function documentPermanentDeleter(documents: Document[]) {
|
||||
|
||||
for (const document of documents) {
|
||||
// Find any attachments that are referenced in the text content
|
||||
const attachmentIdsInText = parseAttachmentIds(document.text);
|
||||
const attachmentIdsInText = ProsemirrorHelper.parseAttachmentIds(
|
||||
DocumentHelper.toProsemirror(document)
|
||||
);
|
||||
|
||||
// Find any attachments that were originally uploaded to this document
|
||||
const attachmentIdsForDocument = (
|
||||
|
||||
Reference in New Issue
Block a user