feat: add bulk import endpoint
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { FastifyInstance } from "fastify";
|
||||
import {
|
||||
bulkImportHandler,
|
||||
createPermitHandler,
|
||||
deletePermitHandler,
|
||||
getPermitHandler,
|
||||
@@ -138,6 +139,15 @@ export async function permitRoutes(fastify: FastifyInstance) {
|
||||
}
|
||||
);
|
||||
|
||||
fastify.post(
|
||||
"/bulkImport",
|
||||
{
|
||||
config: { requiredClaims: ["permit:write"] },
|
||||
preHandler: [fastify.authorize],
|
||||
},
|
||||
bulkImportHandler
|
||||
);
|
||||
|
||||
await noteRoutes(fastify);
|
||||
|
||||
fastify.addHook("onSend", hideFields("permits"));
|
||||
|
||||
Reference in New Issue
Block a user