enhance(backend): 個人宛のお知らせはわかったを押すとアーカイブするように (#14762)

* enhance(backend): 個人宛のお知らせはわかったを押すとアーカイブするように

* Update Changelog

* enhance(frontend): アーカイブ済みのものを読み込めるように

* Update Changelog

* fix changelog

* 🎨
This commit is contained in:
かっこかり
2024-10-14 11:23:26 +09:00
committed by GitHub
parent 521d92014d
commit 8b7290d6b0
3 changed files with 19 additions and 0 deletions

View File

@@ -209,6 +209,13 @@ export class AnnouncementService {
return;
}
const announcement = await this.announcementsRepository.findOneBy({ id: announcementId });
if (announcement != null && announcement.userId === user.id) {
await this.announcementsRepository.update(announcementId, {
isActive: false,
});
}
if ((await this.getUnreadAnnouncements(user)).length === 0) {
this.globalEventService.publishMainStream(user.id, 'readAllAnnouncements');
}