JSON to client (#5553)

This commit is contained in:
Tom Moor
2024-05-24 08:29:00 -04:00
committed by GitHub
parent e1e8257df7
commit d51267b8bc
71 changed files with 651 additions and 378 deletions

View File

@@ -1,8 +1,12 @@
import { Notification } from "@server/models";
import { APIContext } from "@server/types";
import presentUser from "./user";
import { presentComment, presentDocument } from ".";
export default async function presentNotification(notification: Notification) {
export default async function presentNotification(
ctx: APIContext | undefined,
notification: Notification
) {
return {
id: notification.id,
viewedAt: notification.viewedAt,
@@ -18,7 +22,7 @@ export default async function presentNotification(notification: Notification) {
: undefined,
documentId: notification.documentId,
document: notification.document
? await presentDocument(notification.document)
? await presentDocument(ctx, notification.document)
: undefined,
revisionId: notification.revisionId,
collectionId: notification.collectionId,