From cbff9319074f34100130b232fb61d2707a3f969f Mon Sep 17 00:00:00 2001 From: Apoorv Mishra Date: Wed, 19 Apr 2023 17:10:57 +0530 Subject: [PATCH] fix: complete user profile in unnecessary --- server/presenters/notification.ts | 1 - server/routes/api/notifications/notifications.test.ts | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/server/presenters/notification.ts b/server/presenters/notification.ts index b2850d998a..08957f1c0e 100644 --- a/server/presenters/notification.ts +++ b/server/presenters/notification.ts @@ -8,7 +8,6 @@ export default function presentNotification(notification: Notification) { 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, diff --git a/server/routes/api/notifications/notifications.test.ts b/server/routes/api/notifications/notifications.test.ts index 1180a263dd..cf5f183ae6 100644 --- a/server/routes/api/notifications/notifications.test.ts +++ b/server/routes/api/notifications/notifications.test.ts @@ -61,7 +61,7 @@ describe("#notifications.list", () => { expect(body.data.length).toBe(3); expect(body.unseenCount).toBe(2); expect((randomElement(body.data) as any).actor.id).toBe(actor.id); - expect((randomElement(body.data) as any).user.id).toBe(user.id); + expect((randomElement(body.data) as any).userId).toBe(user.id); const events = body.data.map((n: any) => n.event); expect(events).toContain(NotificationEventType.UpdateDocument); expect(events).toContain(NotificationEventType.CreateComment); @@ -118,7 +118,7 @@ describe("#notifications.list", () => { expect(body.data.length).toBe(1); expect(body.unseenCount).toBe(1); expect((randomElement(body.data) as any).actor.id).toBe(actor.id); - expect((randomElement(body.data) as any).user.id).toBe(user.id); + expect((randomElement(body.data) as any).userId).toBe(user.id); const events = body.data.map((n: any) => n.event); expect(events).toContain(NotificationEventType.MentionedInComment); });