From ae252acbb8acdee55e2e9f0973d1049b77e0f564 Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Wed, 30 Oct 2024 14:33:34 +0700 Subject: [PATCH] feat: add get notification single notification --- src/controllers/00-notification-controller.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/controllers/00-notification-controller.ts b/src/controllers/00-notification-controller.ts index a006858..c0c463c 100644 --- a/src/controllers/00-notification-controller.ts +++ b/src/controllers/00-notification-controller.ts @@ -67,9 +67,11 @@ export class NotificationController extends Controller { @Get("{notificationId}") @Security("keycloak") async getNotification(@Request() req: RequestWithUser, @Path() notificationId: string) { - // TODO: implement + const record = await prisma.notification.findFirst({ where: { id: notificationId } }); - return {}; + if (!record) throw notFoundError("Notification"); + + return record; } @Post()