refacto: massive use of getMessageError
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { SeriesService } from "@/lib/services/series.service";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { ERROR_MESSAGES } from "@/constants/errorMessages";
|
||||
import { AppError } from "@/utils/errors";
|
||||
import { KomgaSeries } from "@/types/komga";
|
||||
import { getErrorMessage } from "@/utils/errors";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
@@ -18,7 +18,7 @@ export async function GET(request: Request, { params }: { params: { seriesId: st
|
||||
{
|
||||
error: {
|
||||
code: error.code,
|
||||
message: ERROR_MESSAGES[error.code],
|
||||
message: getErrorMessage(error.code),
|
||||
},
|
||||
},
|
||||
{ status: 500 }
|
||||
@@ -28,7 +28,7 @@ export async function GET(request: Request, { params }: { params: { seriesId: st
|
||||
{
|
||||
error: {
|
||||
code: ERROR_CODES.SERIES.FETCH_ERROR,
|
||||
message: ERROR_MESSAGES[ERROR_CODES.SERIES.FETCH_ERROR],
|
||||
message: getErrorMessage(ERROR_CODES.SERIES.FETCH_ERROR),
|
||||
},
|
||||
},
|
||||
{ status: 500 }
|
||||
|
||||
Reference in New Issue
Block a user