Added revalidate so it will actually pull the front page and update
This commit is contained in:
		| @@ -9,7 +9,6 @@ export const metadata = { | |||||||
|  |  | ||||||
| export default async function HomePage() { | export default async function HomePage() { | ||||||
|   let books: Book[] = []; |   let books: Book[] = []; | ||||||
|  |  | ||||||
|   try { |   try { | ||||||
|     books = await fetchBooks(); |     books = await fetchBooks(); | ||||||
|   } catch (error) { |   } catch (error) { | ||||||
|   | |||||||
| @@ -26,7 +26,7 @@ export async function fetchFromAPI<T>( | |||||||
|   }; |   }; | ||||||
|  |  | ||||||
|   try { |   try { | ||||||
|     const response = await fetch(url, config); |     const response = await fetch(url, {...config, next: {revalidate:30}}); | ||||||
|     if (!response.ok) { |     if (!response.ok) { | ||||||
|       const errorData = await response.json(); |       const errorData = await response.json(); | ||||||
|       console.error(`Error fetching ${url}:`, errorData); |       console.error(`Error fetching ${url}:`, errorData); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user