Add error handling to og test pages

This commit is contained in:
Sam Becker 2024-06-09 13:15:19 -05:00
parent 433d94d5bc
commit a80a8713c4
2 changed files with 16 additions and 8 deletions

View File

@ -12,7 +12,8 @@ export default async function OGPage() {
photos,
count,
] = await Promise.all([
getPhotosCached({ limit: INFINITE_SCROLL_GRID_PHOTO_INITIAL }),
getPhotosCached({ limit: INFINITE_SCROLL_GRID_PHOTO_INITIAL })
.catch(() => []),
getPhotosMeta()
.then(({ count }) => count)
.catch(() => 0),

View File

@ -22,13 +22,20 @@ export default async function OGOverviewPage() {
photosSimulation,
photosFocal,
] = await Promise.all([
getPhotosCached({ limit: 1 }).then(photos => photos[0]),
getPhotosCached({ limit: 1, camera: cameraIcon }).then(photos => photos[0]),
getPhotosCached({ limit: 1, tag }),
getPhotosCached({ limit: 1, tag: TAG_FAVS }),
getPhotosCached({ limit: 1, camera }),
getPhotosCached({ limit: 1, simulation }),
getPhotosCached({ limit: 1, focal }),
getPhotosCached({ limit: 1 }).then(photos => photos[0])
.catch(() => undefined),
getPhotosCached({ limit: 1, camera: cameraIcon }).then(photos => photos[0])
.catch(() => undefined),
getPhotosCached({ limit: 1, tag })
.catch(() => []),
getPhotosCached({ limit: 1, tag: TAG_FAVS })
.catch(() => []),
getPhotosCached({ limit: 1, camera })
.catch(() => []),
getPhotosCached({ limit: 1, simulation })
.catch(() => []),
getPhotosCached({ limit: 1, focal })
.catch(() => []),
]);
return (