feat: notifications.list

This commit is contained in:
Apoorv Mishra committed 2023-04-19 18:43:52 +05:30
1 parent fb8d8f8159
commit 007cbeaab6
5 files changed
+246 -19

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import { Notification } from "@server/models";
import presentUser from "./user";
export default function presentNotification(notification: Notification) {
return {
id: notification.id,
viewedAt: notification.viewedAt,
createdAt: notification.createdAt,
event: notification.event,
userId: notification.userId,
user: presentUser(notification.user),
actorId: notification.actorId,
actor: notification.actor ? presentUser(notification.actor) : undefined,
commentId: notification.commentId,
documentId: notification.documentId,
revisionId: notification.revisionId,
collectionId: notification.collectionId,
teamId: notification.teamId,
};
}