import { BeerPostQueryResult } from '@/services/BeerPost/schema/BeerPostQueryResult'; import getBreweryPostById from '@/services/BreweryPost/getBreweryPostById'; import { GetServerSideProps, NextPage } from 'next'; interface BreweryPageProps { breweryPost: BeerPostQueryResult; } const BreweryByIdPage: NextPage = ({ breweryPost }) => { return ( <>

{breweryPost.name}

); }; export const getServerSideProps: GetServerSideProps = async ( context, ) => { const breweryPost = await getBreweryPostById(context.params!.id! as string); return !breweryPost ? { notFound: true } : { props: { breweryPost: JSON.parse(JSON.stringify(breweryPost)) } }; }; export default BreweryByIdPage;