From e69b8826873813f60c4790c7095ea69cc5987928 Mon Sep 17 00:00:00 2001 From: Yuriy Plotnikov Date: Fri, 8 May 2026 00:30:40 +0300 Subject: [PATCH] Fix deploy and api --- src/app/categories/[categories-detail]/page.tsx | 2 ++ src/app/gallery/[...slug]/page.tsx | 2 ++ src/app/in-stock/[in-stock-detail]/page.tsx | 14 +++----------- src/app/news/[news-detail]/page.tsx | 2 ++ src/app/works/[works-detail]/page.tsx | 12 +++--------- 5 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/app/categories/[categories-detail]/page.tsx b/src/app/categories/[categories-detail]/page.tsx index 5ba5e5df..62256a58 100644 --- a/src/app/categories/[categories-detail]/page.tsx +++ b/src/app/categories/[categories-detail]/page.tsx @@ -6,6 +6,8 @@ import Heading from '@/components/Heading/Heading' import Detail from '@/components/Detail/Detail' import { fetchCollectionItem, getImageUrl } from '@/lib/api-client' +export const dynamic = 'force-dynamic' + type PageProps = { params: Promise<{ 'categories-detail': string diff --git a/src/app/gallery/[...slug]/page.tsx b/src/app/gallery/[...slug]/page.tsx index 6028c685..f286960a 100644 --- a/src/app/gallery/[...slug]/page.tsx +++ b/src/app/gallery/[...slug]/page.tsx @@ -11,6 +11,8 @@ import { buildGalleryBreadcrumbs, } from '@/functions/gallery' +export const dynamic = 'force-dynamic' + type PageParams = { params: Promise<{ slug: string[] diff --git a/src/app/in-stock/[in-stock-detail]/page.tsx b/src/app/in-stock/[in-stock-detail]/page.tsx index 31e0b119..a713df6c 100644 --- a/src/app/in-stock/[in-stock-detail]/page.tsx +++ b/src/app/in-stock/[in-stock-detail]/page.tsx @@ -5,7 +5,9 @@ import { BreadcrumbItem, MasterFromServer, SlideItem, WorkFromServer } from '@/t import Heading from '@/components/Heading/Heading' import Detail from '@/components/Detail/Detail' import Master from '@/components/Master/Master' -import { fetchCollection, fetchCollectionItem, getImageUrl } from '@/lib/api-client' +import { fetchCollectionItem, getImageUrl } from '@/lib/api-client' + +export const dynamic = 'force-dynamic' type PageProps = { params: Promise<{ @@ -41,16 +43,6 @@ export async function generateMetadata({ params }: PageProps): Promise } } -export async function generateStaticParams() { - const works: WorkFromServer[] = await fetchCollection('works', { - filter: { in_stock: true }, - }) - - return works.map((work) => ({ - 'in-stock-detail': work.slug || work._id, - })) -} - export default async function Page({ params }: PageProps): Promise { const { ['in-stock-detail']: slug } = await params diff --git a/src/app/news/[news-detail]/page.tsx b/src/app/news/[news-detail]/page.tsx index 6f9774f8..17d2f029 100644 --- a/src/app/news/[news-detail]/page.tsx +++ b/src/app/news/[news-detail]/page.tsx @@ -6,6 +6,8 @@ import Heading from '@/components/Heading/Heading' import Detail from '@/components/Detail/Detail' import { fetchCollectionItem, getImageUrl } from '@/lib/api-client' +export const dynamic = 'force-dynamic' + type PageParams = { params: Promise<{ 'news-detail': string diff --git a/src/app/works/[works-detail]/page.tsx b/src/app/works/[works-detail]/page.tsx index d0335233..e99d9806 100644 --- a/src/app/works/[works-detail]/page.tsx +++ b/src/app/works/[works-detail]/page.tsx @@ -5,7 +5,9 @@ import { BreadcrumbItem, MasterFromServer, SlideItem, WorkFromServer } from '@/t import Heading from '@/components/Heading/Heading' import Detail from '@/components/Detail/Detail' import Master from '@/components/Master/Master' -import { fetchCollection, fetchCollectionItem, getImageUrl } from '@/lib/api-client' +import { fetchCollectionItem, getImageUrl } from '@/lib/api-client' + +export const dynamic = 'force-dynamic' type PageProps = { params: Promise<{ @@ -41,14 +43,6 @@ export async function generateMetadata({ params }: PageProps): Promise } } -export async function generateStaticParams() { - const works: WorkFromServer[] = await fetchCollection('works') - - return works.map((work) => ({ - 'works-detail': work.slug || work._id, - })) -} - export default async function Page({ params }: PageProps): Promise { const { ['works-detail']: slug } = await params