mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 10:42:08 +00:00
Merge pull request #54 from aaronpo97/beer-style-fix
Fix: Update beer style page to send error 404
This commit is contained in:
@@ -65,6 +65,9 @@ export default BeerStyleByIdPage;
|
|||||||
export const getServerSideProps: GetServerSideProps = async ({ params }) => {
|
export const getServerSideProps: GetServerSideProps = async ({ params }) => {
|
||||||
const id = params!.id as string;
|
const id = params!.id as string;
|
||||||
const beerStyle = await getBeerStyleById(id);
|
const beerStyle = await getBeerStyleById(id);
|
||||||
|
if (!beerStyle) {
|
||||||
|
return { notFound: true };
|
||||||
|
}
|
||||||
|
|
||||||
return { props: { beerStyle: JSON.parse(JSON.stringify(beerStyle)) } };
|
return { props: { beerStyle: JSON.parse(JSON.stringify(beerStyle)) } };
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user