From 0d92ff02049cf6c29abf80e3bee5ee541e4baf81 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Thu, 18 Apr 2024 23:29:25 -0500 Subject: [PATCH] Fix generateStaticParams bug --- src/app/layout.tsx | 3 +-- src/app/p/[photoId]/layout.tsx | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 31ea73f0..a8369748 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -71,8 +71,7 @@ export default function RootLayout({ return ( diff --git a/src/app/p/[photoId]/layout.tsx b/src/app/p/[photoId]/layout.tsx index e014b224..feffdcdc 100644 --- a/src/app/p/[photoId]/layout.tsx +++ b/src/app/p/[photoId]/layout.tsx @@ -17,14 +17,12 @@ import { STATICALLY_OPTIMIZED } from '@/site/config'; import { getPhotosNearIdCachedCached } from '@/photo/cache'; export let generateStaticParams: - (() => Promise<{ params: { photoId: string } }[]>) | undefined = undefined; + (() => Promise<{ photoId: string }[]>) | undefined = undefined; if (STATICALLY_OPTIMIZED) { generateStaticParams = async () => { const photos = await getPhotoIds({ limit: GENERATE_STATIC_PARAMS_LIMIT }); - return photos.map(photoId => ({ - params: { photoId }, - })); + return photos.map(photoId => ({ photoId })); }; }