mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-24 05:46:39 +00:00
add openapi registers
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user