refactor: Amélioration de la page d'accueil et du cache - Suppression du cache.service.ts redondant - Mise à jour de l'ordre des sections (ongoing, onDeck, recentlyRead) - Correction des types et interfaces

This commit is contained in:
Julien Froidefond
2025-02-12 13:09:31 +01:00
parent 28e2248296
commit 0483fee8cd
11 changed files with 306 additions and 336 deletions

View File

@@ -6,9 +6,9 @@ import { useRouter } from "next/navigation";
import { KomgaBook, KomgaSeries } from "@/types/komga";
interface HomeData {
onGoingSeries: KomgaSeries[];
ongoing: KomgaSeries[];
recentlyRead: KomgaBook[];
popularSeries: KomgaSeries[];
onDeck: KomgaBook[];
}
export default function HomePage() {
@@ -29,9 +29,9 @@ export default function HomePage() {
const jsonData = await response.json();
// Transformer les données pour correspondre à l'interface HomeData
setData({
onGoingSeries: jsonData.ongoing || [],
ongoing: jsonData.ongoing || [],
recentlyRead: jsonData.recentlyRead || [],
popularSeries: jsonData.popular || [],
onDeck: jsonData.onDeck || [],
});
} catch (error) {
console.error("Erreur lors de la récupération des données:", error);
@@ -75,6 +75,7 @@ export default function HomePage() {
}
if (!data) return null;
console.log("PAGE", data);
return <HomeContent data={data} />;
}