This commit is contained in:
2023-06-15 00:11:07 +04:00
parent 24222f4521
commit 293b6ea295
6 changed files with 395 additions and 323 deletions

View File

@@ -1,4 +1,3 @@
import { notFound } from 'next/navigation'
import directus from '~/lib/directus'
export const getServerSideProps = async ({ params }) => {
@@ -20,7 +19,7 @@ export const getServerSideProps = async ({ params }) => {
filter: { slug: { _eq: slug } },
})
if (!vendor) return notFound()
if (!vendor) return { notFound: true }
return { props: { vendor } }
}
@@ -79,7 +78,7 @@ export default function VendorPage({ vendor }) {
<h2>Categories</h2>
<ul>
{vendor.categories.map((cat) => (
<li>{cat.categories_id.name}</li>
<li key={cat.id}>{cat.categories_id.name}</li>
))}
</ul>
</>