Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/app/categories/[categories-detail]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/app/gallery/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {
buildGalleryBreadcrumbs,
} from '@/functions/gallery'

export const dynamic = 'force-dynamic'

type PageParams = {
params: Promise<{
slug: string[]
Expand Down
14 changes: 3 additions & 11 deletions src/app/in-stock/[in-stock-detail]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<{
Expand Down Expand Up @@ -41,16 +43,6 @@ export async function generateMetadata({ params }: PageProps): Promise<Metadata>
}
}

export async function generateStaticParams() {
const works: WorkFromServer[] = await fetchCollection<WorkFromServer>('works', {
filter: { in_stock: true },
})

return works.map((work) => ({
'in-stock-detail': work.slug || work._id,
}))
}

export default async function Page({ params }: PageProps): Promise<JSX.Element> {
const { ['in-stock-detail']: slug } = await params

Expand Down
2 changes: 2 additions & 0 deletions src/app/news/[news-detail]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 3 additions & 9 deletions src/app/works/[works-detail]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<{
Expand Down Expand Up @@ -41,14 +43,6 @@ export async function generateMetadata({ params }: PageProps): Promise<Metadata>
}
}

export async function generateStaticParams() {
const works: WorkFromServer[] = await fetchCollection<WorkFromServer>('works')

return works.map((work) => ({
'works-detail': work.slug || work._id,
}))
}

export default async function Page({ params }: PageProps): Promise<JSX.Element> {
const { ['works-detail']: slug } = await params

Expand Down