mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-16 17:51:17 +10:00
feat: openapi support plus more api validation
This commit is contained in:
@ -7,13 +7,16 @@ import { type } from "arktype";
|
||||
import { randomUUID } from "node:crypto";
|
||||
|
||||
const userValidator = type({
|
||||
invitation: "string",
|
||||
username: "string >= 5",
|
||||
email: "string.email",
|
||||
password: "string >= 14",
|
||||
"displayName?": "string | undefined",
|
||||
});
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
export default defineEventHandler<{
|
||||
body: typeof userValidator.infer;
|
||||
}>(async (h3) => {
|
||||
const body = await readBody(h3);
|
||||
|
||||
const invitationId = body.invitation;
|
||||
|
||||
Reference in New Issue
Block a user