fix(backend) api/iの未読のお知らせにcreatedAtを追加するように修正 (#12092)
Co-authored-by: sorairo <sorairo@shiosyakeyakini.info>
This commit is contained in:
parent
3e5c55c14e
commit
6d6ddbc35e
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue