add rts routes
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
updatePermitHandler,
|
||||
} from "./permit.controller";
|
||||
import { $permit } from "./permit.schema";
|
||||
import { hideFields } from "../auth";
|
||||
|
||||
export async function permitRoutes(fastify: FastifyInstance) {
|
||||
fastify.post(
|
||||
@@ -14,9 +15,6 @@ export async function permitRoutes(fastify: FastifyInstance) {
|
||||
{
|
||||
schema: {
|
||||
body: $permit("createPermitInput"),
|
||||
response: {
|
||||
201: $permit("createPermitResponse"),
|
||||
},
|
||||
},
|
||||
config: { requiredClaims: ["permit:write"] },
|
||||
preHandler: [fastify.authorize],
|
||||
@@ -46,9 +44,6 @@ export async function permitRoutes(fastify: FastifyInstance) {
|
||||
{
|
||||
schema: {
|
||||
querystring: $permit("pageQueryParams"),
|
||||
response: {
|
||||
200: $permit("listPermitResponse"),
|
||||
},
|
||||
},
|
||||
|
||||
config: { requiredClaims: ["permit:read"] },
|
||||
@@ -66,9 +61,6 @@ export async function permitRoutes(fastify: FastifyInstance) {
|
||||
properties: { permitId: { type: "string" } },
|
||||
},
|
||||
body: $permit("updatePermitInput"),
|
||||
response: {
|
||||
200: $permit("getPermitResponse"),
|
||||
},
|
||||
},
|
||||
},
|
||||
updatePermitHandler
|
||||
@@ -88,4 +80,6 @@ export async function permitRoutes(fastify: FastifyInstance) {
|
||||
},
|
||||
deletePermitHandler
|
||||
);
|
||||
|
||||
fastify.addHook("onSend", hideFields("permits"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user