add get notification route

This commit is contained in:
2025-06-27 14:53:42 +05:30
parent 76e703d5f0
commit 6e73e32df7
3 changed files with 40 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ import { $notification } from "./notification.schema";
import {
createNotificationHandler,
deleteNotificationHandler,
getNotificationHandler,
listNotificationsHandler,
updateNotificationHandler,
} from "./notification.controller";
@@ -22,6 +23,18 @@ export async function notificationRoutes(fastify: FastifyInstance) {
createNotificationHandler
);
fastify.get(
"/:notifId",
{
schema: {
params: { type: "object", properties: { notifId: { type: "string" } } },
},
config: { requiredClaims: ["notification:read"] },
preHandler: [fastify.authorize],
},
getNotificationHandler
);
fastify.get(
"/",
{