mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-10 12:46:37 +00:00
add update role openapi registry
This commit is contained in:
@@ -10,6 +10,7 @@ import logger from "@server/logger";
|
|||||||
import { fromError } from "zod-validation-error";
|
import { fromError } from "zod-validation-error";
|
||||||
import { build } from "@server/build";
|
import { build } from "@server/build";
|
||||||
import { isLicensedOrSubscribed } from "@server/lib/isLicencedOrSubscribed";
|
import { isLicensedOrSubscribed } from "@server/lib/isLicencedOrSubscribed";
|
||||||
|
import { OpenAPITags, registry } from "@server/openApi";
|
||||||
|
|
||||||
const updateRoleParamsSchema = z.strictObject({
|
const updateRoleParamsSchema = z.strictObject({
|
||||||
orgId: z.string(),
|
orgId: z.string(),
|
||||||
@@ -30,6 +31,24 @@ export type UpdateRoleBody = z.infer<typeof updateRoleBodySchema>;
|
|||||||
|
|
||||||
export type UpdateRoleResponse = Role;
|
export type UpdateRoleResponse = Role;
|
||||||
|
|
||||||
|
registry.registerPath({
|
||||||
|
method: "post",
|
||||||
|
path: "/org/{orgId}/role/{roleId}",
|
||||||
|
description: "Update a role.",
|
||||||
|
tags: [OpenAPITags.Role],
|
||||||
|
request: {
|
||||||
|
params: updateRoleParamsSchema,
|
||||||
|
body: {
|
||||||
|
content: {
|
||||||
|
"application/json": {
|
||||||
|
schema: updateRoleBodySchema
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
responses: {}
|
||||||
|
});
|
||||||
|
|
||||||
export async function updateRole(
|
export async function updateRole(
|
||||||
req: Request,
|
req: Request,
|
||||||
res: Response,
|
res: Response,
|
||||||
|
|||||||
Reference in New Issue
Block a user