Make homepage queries resilient to error for initial setup
This commit is contained in:
parent
756cbc7f1b
commit
4d5249cc08
@ -27,8 +27,10 @@ export default async function HomePage({ searchParams }: PaginationParams) {
|
||||
photos,
|
||||
count,
|
||||
] = await Promise.all([
|
||||
getPhotosCached({ limit }),
|
||||
getPhotosCountCached(),
|
||||
// Make homepage queries resilient to error
|
||||
// for initial setup when database may not exist
|
||||
getPhotosCached({ limit }).catch(() => []),
|
||||
getPhotosCountCached().catch(() => 0),
|
||||
]);
|
||||
|
||||
const showMorePhotos = count > photos.length;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user