I want to pass projectID from the previous page(/projects) to the (/project/[projectName]). Therefore, in order to fetch a project details, i have to fire an API endpoint with projectID.
What is the right way to pass projectID from the previous page and also how to access it in the getServersideProps method.
In the /project/[projectName] page,
export async function getServerSideProps(){
// Here i want to access the projectID sent from the previous page
const data = await fetchData();
return {
props: data,
};
}
Query/param prop will have access to the projectName but not projectID.