diff --git a/src/pages/dashboards/view/[id].tsx b/src/pages/dashboards/view/[id].tsx index bce791b..128f9f5 100644 --- a/src/pages/dashboards/view/[id].tsx +++ b/src/pages/dashboards/view/[id].tsx @@ -1,4 +1,5 @@ import { GetServerSideProps, NextPage } from "next"; +import Error from "next/error"; import Link from "next/link"; import { DashboardItem } from "../../../backend/dashboards"; @@ -32,6 +33,10 @@ export const getServerSideProps: GetServerSideProps = async ( platformsConfig ); + if (!dashboardItem) { + context.res.statusCode = 404; + } + return { props: { dashboardForecasts: frontendDashboardForecasts, @@ -89,7 +94,9 @@ const ViewDashboardPage: NextPage = ({
{dashboardItem ? ( - ) : null} + ) : ( + + )}