WIP
This commit is contained in:
5
frontend/pages/vendors/[slug]/index.js
vendored
5
frontend/pages/vendors/[slug]/index.js
vendored
@@ -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>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user