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

View file

@ -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;