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,7 +1,28 @@
import { FastifyRequest, FastifyReply } from "fastify";
import { PageQueryParams } from "../pagination";
import { listNotifications, updateNotification } from "./notification.service";
import { UpdateNotificationInput } from "./notification.schema";
import {
createNotification,
listNotifications,
updateNotification,
} from "./notification.service";
import {
CreateNotificationInput,
UpdateNotificationInput,
} from "./notification.schema";
export async function createNotificationHandler(
req: FastifyRequest,
res: FastifyReply
) {
const input = req.body as CreateNotificationInput;
try {
const notification = await createNotification(input, req.user.tenantId);
return res.code(201).send(notification);
} catch (err) {
return err;
}
}
export async function listNotificationsHandler(
req: FastifyRequest,