add notification create route, update permit update rotue

This commit is contained in:
2025-03-27 11:08:49 +05:30
parent 300e67bcb7
commit 3e68d594d2
7 changed files with 70 additions and 4 deletions

View File

@@ -1,11 +1,24 @@
import { FastifyInstance } from "fastify";
import { $notification } from "./notification.schema";
import {
createNotificationHandler,
listNotificationsHandler,
updateNotificationHandler,
} from "./notification.controller";
export async function notificationRoutes(fastify: FastifyInstance) {
fastify.post(
"/",
{
schema: {
body: $notification("createNotificationInput"),
},
config: { requiredClaims: ["notification:write"] },
preHandler: [fastify.authorize],
},
createNotificationHandler
);
fastify.get(
"/",
{