refacto: error and types

This commit is contained in:
Julien Froidefond
2025-02-27 21:59:14 +01:00
parent ea51ff53a9
commit 279f6c6e88
37 changed files with 800 additions and 684 deletions

View File

@@ -22,6 +22,7 @@ export async function POST(request: Request) {
{
error: {
code: ERROR_CODES.MIDDLEWARE.UNAUTHORIZED,
name: "Unauthorized",
message: getErrorMessage(ERROR_CODES.MIDDLEWARE.UNAUTHORIZED),
},
},
@@ -32,6 +33,7 @@ export async function POST(request: Request) {
{
error: {
code: ERROR_CODES.CONFIG.SAVE_ERROR,
name: "Config save error",
message: getErrorMessage(ERROR_CODES.CONFIG.SAVE_ERROR),
},
},
@@ -53,6 +55,7 @@ export async function GET() {
{
error: {
code: ERROR_CODES.MIDDLEWARE.UNAUTHORIZED,
name: "Unauthorized",
message: getErrorMessage(ERROR_CODES.MIDDLEWARE.UNAUTHORIZED),
},
},
@@ -64,6 +67,7 @@ export async function GET() {
{
error: {
code: ERROR_CODES.KOMGA.MISSING_CONFIG,
name: "Missing config",
message: getErrorMessage(ERROR_CODES.KOMGA.MISSING_CONFIG),
},
},
@@ -75,6 +79,7 @@ export async function GET() {
{
error: {
code: ERROR_CODES.CONFIG.FETCH_ERROR,
name: "Config fetch error",
message: getErrorMessage(ERROR_CODES.CONFIG.FETCH_ERROR),
},
},