Adds content column to documents and revisions as JSON snapshot (#6179)

This commit is contained in:
Tom Moor
2023-12-17 10:51:11 -05:00
committed by GitHub
parent 78b9322a28
commit 1840370e6f
18 changed files with 411 additions and 174 deletions

View File

@@ -1,7 +1,7 @@
import { Transaction } from "sequelize";
import { Optional } from "utility-types";
import { Document, Event, User } from "@server/models";
import DocumentHelper from "@server/models/helpers/DocumentHelper";
import TextHelper from "@server/models/helpers/TextHelper";
type Props = Optional<
Pick<
@@ -90,12 +90,12 @@ export default async function documentCreator({
sourceMetadata,
fullWidth: templateDocument ? templateDocument.fullWidth : fullWidth,
emoji: templateDocument ? templateDocument.emoji : emoji,
title: DocumentHelper.replaceTemplateVariables(
title: TextHelper.replaceTemplateVariables(
templateDocument ? templateDocument.title : title,
user
),
text: await DocumentHelper.replaceImagesWithAttachments(
DocumentHelper.replaceTemplateVariables(
text: await TextHelper.replaceImagesWithAttachments(
TextHelper.replaceTemplateVariables(
templateDocument ? templateDocument.text : text,
user
),