add notification delete route
This commit is contained in:
@@ -2,6 +2,7 @@ import { FastifyInstance } from "fastify";
|
||||
import { $notification } from "./notification.schema";
|
||||
import {
|
||||
createNotificationHandler,
|
||||
deleteNotificationHandler,
|
||||
listNotificationsHandler,
|
||||
updateNotificationHandler,
|
||||
} from "./notification.controller";
|
||||
@@ -45,6 +46,24 @@ export async function notificationRoutes(fastify: FastifyInstance) {
|
||||
updateNotificationHandler
|
||||
);
|
||||
|
||||
fastify.delete(
|
||||
"/:notifId",
|
||||
{
|
||||
schema: {
|
||||
params: {
|
||||
type: "object",
|
||||
properties: {
|
||||
notifId: { type: "string" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
config: { requiredClaims: ["notification:delete"] },
|
||||
preHandler: [fastify.authorize],
|
||||
},
|
||||
deleteNotificationHandler
|
||||
);
|
||||
|
||||
fastify.get(
|
||||
"/fields/:field",
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user