Added revalidate so it will actually pull the front page and update
This commit is contained in:
parent
89cff766bf
commit
3fb1c6434a
@ -9,7 +9,6 @@ export const metadata = {
|
||||
|
||||
export default async function HomePage() {
|
||||
let books: Book[] = [];
|
||||
|
||||
try {
|
||||
books = await fetchBooks();
|
||||
} catch (error) {
|
||||
|
@ -26,7 +26,7 @@ export async function fetchFromAPI<T>(
|
||||
};
|
||||
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user