grand commit
This commit is contained in:
22
app/[locale]/(root)/(shop)/catalog/page.tsx
Normal file
22
app/[locale]/(root)/(shop)/catalog/page.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import {getCatalogIndexData} from '@prisma/client/sql'
|
||||
import {getLocale} from 'next-intl/server'
|
||||
import {notFound} from 'next/navigation'
|
||||
|
||||
import CategoryPageIndex from '@/components/pages/category/page'
|
||||
import {CategoryPageSqlSchema} from '@/lib/data/models/sqlSchemas'
|
||||
import {db} from '@/lib/db/prisma/client'
|
||||
|
||||
export default async function CatalogPage({
|
||||
params
|
||||
}: {
|
||||
params: Promise<{slug?: string}>
|
||||
}) {
|
||||
const loc = await getLocale()
|
||||
const catalog: CategoryPageSqlSchema[] = await db.$queryRawTyped(
|
||||
getCatalogIndexData(loc)
|
||||
)
|
||||
|
||||
if (catalog.length < 1) notFound()
|
||||
|
||||
return <CategoryPageIndex data={catalog} />
|
||||
}
|
||||
Reference in New Issue
Block a user