refactor(api): 🏷️ Port all /api/v1/accounts to use new schemas
Some checks failed
Mirror to Codeberg / Mirror (push) Failing after 0s

This commit is contained in:
Jesse Wierzbinski 2025-02-13 01:31:15 +01:00
parent a0ce18337a
commit e3e285571e
No known key found for this signature in database
44 changed files with 840 additions and 475 deletions

View file

@ -29,7 +29,35 @@ import { fromZodError } from "zod-validation-error";
import { ApiError } from "~/classes/errors/api-error";
import type { AuthData } from "~/classes/functions/user";
import { config } from "~/packages/config-manager/index.ts";
import type { HonoEnv } from "~/types/api";
import { ErrorSchema, type HonoEnv } from "~/types/api";
export const reusedResponses = {
401: {
description: "Invalid or missing Authorization header.",
content: {
"application/json": {
schema: ErrorSchema,
},
},
},
422: {
description: "Invalid values in request",
content: {
"application/json": {
schema: ErrorSchema,
},
},
},
};
export const accountNotFound = {
description: "Account does not exist",
content: {
"application/json": {
schema: ErrorSchema,
},
},
};
export const apiRoute = (fn: (app: OpenAPIHono<HonoEnv>) => void): typeof fn =>
fn;