I would like to use the film title in my route URL (eg films/fletch), but the subsequent getServerSideProps
request requires the episode_id.
How do I pass both film.episode_id and film.title to films/[id]/index.js?
Movies.js
<Link
href={{
pathname: `/films/[id]`,
query: {
id: film.episode_id
},
}}
as={`/films/${encodeURIComponent(film.title)}`} >
<a>{film.title}</a>
</Link>
films/[id]/index.js
import {useRouter} from 'next/router'
const movie = () => {
const router = useRouter();
console.log(router);
const { id } = router.query
return (
<div>Movie page for <strong>{id}</strong></div>
)
}