refacto: types big review

This commit is contained in:
Julien Froidefond
2025-02-27 08:29:08 +01:00
parent 3b2d4cb0d5
commit 3c46afb294
39 changed files with 209 additions and 178 deletions

View File

@@ -11,7 +11,7 @@ export async function GET(
{ params }: { params: { bookId: string; pageNumber: string } }
) {
try {
const pageNumber = parseInt(params.pageNumber);
const pageNumber: number = parseInt(params.pageNumber);
if (isNaN(pageNumber) || pageNumber < 0) {
return NextResponse.json(
{

View File

@@ -3,10 +3,10 @@ import { BookService } from "@/lib/services/book.service";
import { ERROR_CODES } from "@/constants/errorCodes";
import { ERROR_MESSAGES } from "@/constants/errorMessages";
import { AppError } from "@/utils/errors";
import { KomgaBookWithPages } from "@/types/komga";
export async function GET(request: Request, { params }: { params: { bookId: string } }) {
try {
const data = await BookService.getBook(params.bookId);
const data: KomgaBookWithPages = await BookService.getBook(params.bookId);
return NextResponse.json(data);
} catch (error) {
console.error("API Books - Erreur:", error);