add openapi registers

This commit is contained in:
miloschwartz
2025-04-06 22:44:14 -04:00
parent a76e3e00f7
commit d260450a84
50 changed files with 852 additions and 60 deletions

View File

@@ -19,6 +19,7 @@ import { createAdminRole } from "@server/setup/ensureActions";
import config from "@server/lib/config";
import { fromError } from "zod-validation-error";
import { defaultRoleAllowedActions } from "../role";
import { OpenAPITags, registry } from "@server/openApi";
const createOrgSchema = z
.object({
@@ -29,6 +30,23 @@ const createOrgSchema = z
// const MAX_ORGS = 5;
registry.registerPath({
method: "put",
path: "/org",
description: "Create a new organization",
tags: [OpenAPITags.Org],
request: {
body: {
content: {
"application/json": {
schema: createOrgSchema
}
}
}
},
responses: {}
});
export async function createOrg(
req: Request,
res: Response,