add update role openapi registry

This commit is contained in:
miloschwartz
2026-01-19 20:12:35 -08:00
parent e8a8b3f664
commit 9527fe4f26

View File

@@ -10,6 +10,7 @@ import logger from "@server/logger";
import { fromError } from "zod-validation-error";
import { build } from "@server/build";
import { isLicensedOrSubscribed } from "@server/lib/isLicencedOrSubscribed";
import { OpenAPITags, registry } from "@server/openApi";
const updateRoleParamsSchema = z.strictObject({
orgId: z.string(),
@@ -30,6 +31,24 @@ export type UpdateRoleBody = z.infer<typeof updateRoleBodySchema>;
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(
req: Request,
res: Response,