Adds content column to documents and revisions as JSON snapshot (#6179)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { traceFunction } from "@server/logging/tracing";
|
||||
import { Document } from "@server/models";
|
||||
import DocumentHelper from "@server/models/helpers/DocumentHelper";
|
||||
import TextHelper from "@server/models/helpers/TextHelper";
|
||||
import presentUser from "./user";
|
||||
|
||||
type Options = {
|
||||
@@ -16,10 +16,7 @@ async function presentDocument(
|
||||
...options,
|
||||
};
|
||||
const text = options.isPublic
|
||||
? await DocumentHelper.attachmentsToSignedUrls(
|
||||
document.text,
|
||||
document.teamId
|
||||
)
|
||||
? await TextHelper.attachmentsToSignedUrls(document.text, document.teamId)
|
||||
: document.text;
|
||||
|
||||
const data: Record<string, any> = {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import parseTitle from "@shared/utils/parseTitle";
|
||||
import { traceFunction } from "@server/logging/tracing";
|
||||
import { Revision } from "@server/models";
|
||||
import DocumentHelper from "@server/models/helpers/DocumentHelper";
|
||||
import presentUser from "./user";
|
||||
|
||||
async function presentRevision(revision: Revision, diff?: string) {
|
||||
@@ -11,7 +12,7 @@ async function presentRevision(revision: Revision, diff?: string) {
|
||||
id: revision.id,
|
||||
documentId: revision.documentId,
|
||||
title: strippedTitle,
|
||||
text: revision.text,
|
||||
text: DocumentHelper.toMarkdown(revision),
|
||||
emoji: revision.emoji ?? emoji,
|
||||
html: diff,
|
||||
createdAt: revision.createdAt,
|
||||
|
||||
Reference in New Issue
Block a user