From b3ab96b5ee9e84a3393c20f917ebf7f1fa178347 Mon Sep 17 00:00:00 2001
From: syuilo <Syuilotan@yahoo.co.jp>
Date: Thu, 21 Dec 2023 11:23:31 +0900
Subject: [PATCH] =?UTF-8?q?fix(backend):=20=E3=83=AD=E3=83=BC=E3=83=AB?=
 =?UTF-8?q?=E3=82=A2=E3=82=B5=E3=82=A4=E3=83=B3=E3=81=AE=E9=80=9A=E7=9F=A5?=
 =?UTF-8?q?=E3=81=8C=E3=81=82=E3=82=8B=E7=8A=B6=E6=85=8B=E3=81=A7=E3=83=9A?=
 =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=82=92=E3=83=AA=E3=83=AD=E3=83=BC=E3=83=89?=
 =?UTF-8?q?=E3=81=99=E3=82=8B=E3=81=A8=E9=80=9A=E7=9F=A5=E6=AC=84=E3=81=AB?=
 =?UTF-8?q?=E4=BD=95=E3=82=82=E3=81=A7=E3=81=AA=E3=81=8F=E3=81=AA=E3=82=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fix #12729
---
 .../backend/src/core/entities/NotificationEntityService.ts   | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/packages/backend/src/core/entities/NotificationEntityService.ts b/packages/backend/src/core/entities/NotificationEntityService.ts
index f2124998ac..704081ed00 100644
--- a/packages/backend/src/core/entities/NotificationEntityService.ts
+++ b/packages/backend/src/core/entities/NotificationEntityService.ts
@@ -219,6 +219,8 @@ export class NotificationEntityService implements OnModuleInit {
 			});
 		}
 
+		const role = notification.type === 'roleAssigned' ? await this.roleEntityService.pack(notification.roleId) : undefined;
+
 		return await awaitAll({
 			id: notification.id,
 			createdAt: new Date(notification.createdAt).toISOString(),
@@ -229,6 +231,9 @@ export class NotificationEntityService implements OnModuleInit {
 			...(notification.type === 'reaction' ? {
 				reaction: notification.reaction,
 			} : {}),
+			...(notification.type === 'roleAssigned' ? {
+				role: role,
+			} : {}),
 			...(notification.type === 'achievementEarned' ? {
 				achievement: notification.achievement,
 			} : {}),
-- 
GitLab