(disclaimer: i dont think this is an api route question per say, but im a beginner so maybe it is?)
trying to use a dynamic route of localhost:3000/[company_name]/[event_id]
for ex, i'd like to be able to reach localhost:3000/Blah-Company/1
folder structure is image #1, and this is what im trying to do in [event_id].jsx:
export const getStaticPaths = async () => {
return {
paths: [{ params: { company_name: '1' } }, { params: { event_id: '2' } }],
fallback: false, // can also be true or 'blocking'
}
}
export async function getStaticProps(context) {
console.log('context: ', context);
return {
// Passed to the page component as props
props: { post: {} },
}
}
export default function Test({ post }) {
return (
<div className="min-h-screen bg-white secondary font-Inter_rsms">
<p>test</p>
</div>
)
}
but im being thrown this error: Error: A required parameter (event_id) was not provided as a string in getStaticPaths for /[company_name]/[event_id] while on localhost:3000/Blah-Company/1