diff --git a/src/explore-education-statistics-frontend/src/modules/find-statistics/PublicationReleasePage.tsx b/src/explore-education-statistics-frontend/src/modules/find-statistics/PublicationReleasePage.tsx index 51069abe597..088fe592c9b 100644 --- a/src/explore-education-statistics-frontend/src/modules/find-statistics/PublicationReleasePage.tsx +++ b/src/explore-education-statistics-frontend/src/modules/find-statistics/PublicationReleasePage.tsx @@ -29,7 +29,7 @@ import { logEvent } from '@frontend/services/googleAnalyticsService'; import glossaryService from '@frontend/services/glossaryService'; import classNames from 'classnames'; import orderBy from 'lodash/orderBy'; -import { GetStaticPaths, GetStaticProps, NextPage } from 'next'; +import { GetServerSideProps, NextPage } from 'next'; import React from 'react'; import VisuallyHidden from '@common/components/VisuallyHidden'; import ScrollableContainer from '@common/components/ScrollableContainer'; @@ -571,11 +571,13 @@ const PublicationReleasePage: NextPage = ({ release }) => { ); }; -export const getStaticProps: GetStaticProps = async ({ params }) => { +export const getServerSideProps: GetServerSideProps = async ({ + query, +}) => { const { publication: publicationSlug, release: releaseSlug, - } = params as Dictionary; + } = query as Dictionary; const release = await (releaseSlug ? publicationService.getPublicationRelease(publicationSlug, releaseSlug) @@ -585,14 +587,6 @@ export const getStaticProps: GetStaticProps = async ({ params }) => { props: { release, }, - revalidate: process.env.APP_ENV === 'Local' ? 2 : 10, - }; -}; - -export const getStaticPaths: GetStaticPaths = async () => { - return { - paths: [], - fallback: 'blocking', }; }; diff --git a/src/explore-education-statistics-frontend/src/pages/find-statistics/[publication].tsx b/src/explore-education-statistics-frontend/src/pages/find-statistics/[publication].tsx index 7b230dcf8c9..3d146846002 100644 --- a/src/explore-education-statistics-frontend/src/pages/find-statistics/[publication].tsx +++ b/src/explore-education-statistics-frontend/src/pages/find-statistics/[publication].tsx @@ -1,5 +1,4 @@ export { default, - getStaticProps, - getStaticPaths, + getServerSideProps, } from '@frontend/modules/find-statistics/PublicationReleasePage'; diff --git a/src/explore-education-statistics-frontend/src/pages/find-statistics/[publication]/[release].tsx b/src/explore-education-statistics-frontend/src/pages/find-statistics/[publication]/[release].tsx index 7b230dcf8c9..3d146846002 100644 --- a/src/explore-education-statistics-frontend/src/pages/find-statistics/[publication]/[release].tsx +++ b/src/explore-education-statistics-frontend/src/pages/find-statistics/[publication]/[release].tsx @@ -1,5 +1,4 @@ export { default, - getStaticProps, - getStaticPaths, + getServerSideProps, } from '@frontend/modules/find-statistics/PublicationReleasePage';