From 6d6ddbc35e6b933d5401291dc8b5bca9dc20477e Mon Sep 17 00:00:00 2001 From: shiosyakeyakini Date: Sat, 21 Oct 2023 07:53:57 +0900 Subject: [PATCH] =?UTF-8?q?fix(backend)=20api/i=E3=81=AE=E6=9C=AA=E8=AA=AD?= =?UTF-8?q?=E3=81=AE=E3=81=8A=E7=9F=A5=E3=82=89=E3=81=9B=E3=81=ABcreatedAt?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3=20(#12092)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: sorairo --- packages/backend/src/core/entities/UserEntityService.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/core/entities/UserEntityService.ts b/packages/backend/src/core/entities/UserEntityService.ts index 4a3ca00849..b0577fc1a0 100644 --- a/packages/backend/src/core/entities/UserEntityService.ts +++ b/packages/backend/src/core/entities/UserEntityService.ts @@ -322,7 +322,11 @@ export class UserEntityService implements OnModuleInit { const isModerator = isMe && opts.detail ? this.roleService.isModerator(user) : null; const isAdmin = isMe && opts.detail ? this.roleService.isAdministrator(user) : null; - const unreadAnnouncements = isMe && opts.detail ? await this.announcementService.getUnreadAnnouncements(user) : null; + const unreadAnnouncements = isMe && opts.detail ? + (await this.announcementService.getUnreadAnnouncements(user)).map((announcement) => ({ + createdAt: this.idService.parse(announcement.id).date.toISOString(), + ...announcement, + })) : null; const falsy = opts.detail ? false : undefined;