fix(backend) api/iの未読のお知らせにcreatedAtを追加するように修正 (#12092)

Co-authored-by: sorairo <sorairo@shiosyakeyakini.info>
This commit is contained in:
shiosyakeyakini 2023-10-21 07:53:57 +09:00 committed by GitHub
parent 3e5c55c14e
commit 6d6ddbc35e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -322,7 +322,11 @@ export class UserEntityService implements OnModuleInit {
const isModerator = isMe && opts.detail ? this.roleService.isModerator(user) : null; const isModerator = isMe && opts.detail ? this.roleService.isModerator(user) : null;
const isAdmin = isMe && opts.detail ? this.roleService.isAdministrator(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; const falsy = opts.detail ? false : undefined;