mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor(api): ♻️ Properly reuse error messages and schemas
This commit is contained in:
parent
7112a66e4c
commit
65e2e19ff1
84 changed files with 478 additions and 597 deletions
|
|
@ -9,7 +9,7 @@ import { Likes, Notes } from "@versia/kit/tables";
|
|||
import { and, eq, inArray, sql } from "drizzle-orm";
|
||||
import { ApiError } from "~/classes/errors/api-error";
|
||||
import { config } from "~/config.ts";
|
||||
import { ErrorSchema, type KnownEntity } from "~/types/api";
|
||||
import type { KnownEntity } from "~/types/api";
|
||||
|
||||
const route = createRoute({
|
||||
method: "get",
|
||||
|
|
@ -33,7 +33,7 @@ const route = createRoute({
|
|||
description: "Object not found",
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: ErrorSchema,
|
||||
schema: ApiError.zodSchema,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -41,7 +41,7 @@ const route = createRoute({
|
|||
description: "Cannot view objects from remote instances",
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: ErrorSchema,
|
||||
schema: ApiError.zodSchema,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue