add notification create route, update permit update rotue
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user