mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-28 15:56:39 +00:00
add openapi registers
This commit is contained in:
@@ -14,6 +14,7 @@ import { hashPassword } from "@server/auth/password";
|
||||
import { fromError } from "zod-validation-error";
|
||||
import { sendEmail } from "@server/emails";
|
||||
import SendInviteLink from "@server/emails/templates/SendInviteLink";
|
||||
import { OpenAPITags, registry } from "@server/openApi";
|
||||
|
||||
const inviteUserParamsSchema = z
|
||||
.object({
|
||||
@@ -42,6 +43,24 @@ export type InviteUserResponse = {
|
||||
|
||||
const inviteTracker: Record<string, { timestamps: number[] }> = {};
|
||||
|
||||
registry.registerPath({
|
||||
method: "post",
|
||||
path: "/org/{orgId}/create-invite",
|
||||
description: "Invite a user to join an organization.",
|
||||
tags: [OpenAPITags.Org],
|
||||
request: {
|
||||
params: inviteUserParamsSchema,
|
||||
body: {
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: inviteUserBodySchema
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
responses: {}
|
||||
});
|
||||
|
||||
export async function inviteUser(
|
||||
req: Request,
|
||||
res: Response,
|
||||
|
||||
Reference in New Issue
Block a user