mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
fix: Include text in revisions payload as documented
This commit is contained in:
@@ -4,22 +4,26 @@ import type { Revision } from "@server/models";
|
||||
import { DocumentHelper } from "@server/models/helpers/DocumentHelper";
|
||||
import presentUser from "./user";
|
||||
|
||||
async function presentRevision(revision: Revision, html?: string) {
|
||||
async function presentRevision(revision: Revision) {
|
||||
// TODO: Remove this fallback once all revisions have been migrated
|
||||
const { emoji, strippedTitle } = parseTitle(revision.title);
|
||||
|
||||
const [data, text, collaborators] = await Promise.all([
|
||||
DocumentHelper.toJSON(revision),
|
||||
DocumentHelper.toMarkdown(revision),
|
||||
revision.collaborators,
|
||||
]);
|
||||
|
||||
return {
|
||||
id: revision.id,
|
||||
documentId: revision.documentId,
|
||||
title: strippedTitle,
|
||||
name: revision.name,
|
||||
data: await DocumentHelper.toJSON(revision),
|
||||
data,
|
||||
text,
|
||||
icon: revision.icon ?? emoji,
|
||||
color: revision.color,
|
||||
collaborators: (await revision.collaborators).map((user) =>
|
||||
presentUser(user)
|
||||
),
|
||||
html,
|
||||
collaborators: collaborators.map((user) => presentUser(user)),
|
||||
createdAt: revision.createdAt,
|
||||
createdBy: presentUser(revision.user),
|
||||
createdById: revision.userId,
|
||||
|
||||
Reference in New Issue
Block a user