diff --git a/src/app/page.tsx b/src/app/page.tsx index fcdbd43..2a5bbfc 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -9,7 +9,6 @@ export const metadata = { export default async function HomePage() { let books: Book[] = []; - try { books = await fetchBooks(); } catch (error) { diff --git a/src/lib/api.tsx b/src/lib/api.tsx index 5d8cada..8da0e1d 100644 --- a/src/lib/api.tsx +++ b/src/lib/api.tsx @@ -26,7 +26,7 @@ export async function fetchFromAPI( }; try { - const response = await fetch(url, config); + const response = await fetch(url, {...config, next: {revalidate:30}}); if (!response.ok) { const errorData = await response.json(); console.error(`Error fetching ${url}:`, errorData);