Merge pull request #54 from aaronpo97/beer-style-fix

Fix: Update beer style page to send error 404
This commit is contained in:
Aaron Po
2023-10-30 00:47:40 -04:00
committed by GitHub

View File

@@ -65,6 +65,9 @@ export default BeerStyleByIdPage;
export const getServerSideProps: GetServerSideProps = async ({ params }) => {
const id = params!.id as string;
const beerStyle = await getBeerStyleById(id);
if (!beerStyle) {
return { notFound: true };
}
return { props: { beerStyle: JSON.parse(JSON.stringify(beerStyle)) } };
};