Add permits module

This commit is contained in:
2024-12-21 16:26:01 +05:30
parent cc2665544b
commit 6c1399ddd4
9 changed files with 412 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ import { orgSchemas } from "./organization/organization.schema";
import { tokenSchemas } from "./tokens/token.schema";
import { errorHandler } from "./utils/errors";
import { authHandler, authorize } from "./auth";
import { permitSchemas } from "./permit/permit.schema";
const app = fastify({ logger: true });
@@ -19,7 +20,12 @@ app.setErrorHandler(errorHandler);
app.addHook("onRequest", authHandler);
app.register(routes, { prefix: "/api/v1" });
for (const schema of [...userSchemas, ...orgSchemas, ...tokenSchemas]) {
for (const schema of [
...userSchemas,
...orgSchemas,
...tokenSchemas,
...permitSchemas,
]) {
app.addSchema(schema);
}