JSON to client (#5553)
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
NotificationEventType,
|
||||
UserRole,
|
||||
} from "@shared/types";
|
||||
import { parser } from "@server/editor";
|
||||
import {
|
||||
Share,
|
||||
Team,
|
||||
@@ -371,10 +372,12 @@ export async function buildDocument(
|
||||
overrides.collectionId = collection.id;
|
||||
}
|
||||
|
||||
const text = overrides.text ?? "This is the text in an example document";
|
||||
const document = await Document.create(
|
||||
{
|
||||
title: faker.lorem.words(4),
|
||||
text: "This is the text in an example document",
|
||||
content: overrides.content ?? parser.parse(text)?.toJSON(),
|
||||
text,
|
||||
publishedAt: isNull(overrides.collectionId) ? null : new Date(),
|
||||
lastModifiedById: overrides.userId,
|
||||
createdById: overrides.userId,
|
||||
@@ -410,6 +413,7 @@ export async function buildComment(overrides: {
|
||||
type: "paragraph",
|
||||
content: [
|
||||
{
|
||||
content: [],
|
||||
type: "text",
|
||||
text: "test",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user