created changes endpoint

This commit is contained in:
2025-05-23 10:06:37 +05:30
parent 5ff67b751c
commit 564bfc061e
4 changed files with 76 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
import { FastifyInstance } from "fastify";
import {
deletePermitHandler,
getPermitChangesHandler,
getPermitHandler,
listPermitsHandler,
searchPermitHandler,
@@ -120,6 +121,21 @@ export async function permitRoutes(fastify: FastifyInstance) {
}
);
fastify.get(
"/:permitId/changes",
{
schema: {
params: {
type: "object",
properties: { permitId: { type: "string" } },
},
},
config: { requiredClaims: ["permit:read"] },
preHandler: [fastify.authorize],
},
getPermitChangesHandler
);
await noteRoutes(fastify);
fastify.addHook("onSend", hideFields("permits"));