From 9eee4b16d56f17d244a5b820353a3f4a4ac906ac Mon Sep 17 00:00:00 2001 From: Alex Patterson Date: Wed, 29 Sep 2021 09:28:31 -0400 Subject: [PATCH] change course to static --- .../main/src/pages/course/[coursePath]/index.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/frontend/main/src/pages/course/[coursePath]/index.tsx b/frontend/main/src/pages/course/[coursePath]/index.tsx index 8fba8f201..11aac318d 100644 --- a/frontend/main/src/pages/course/[coursePath]/index.tsx +++ b/frontend/main/src/pages/course/[coursePath]/index.tsx @@ -5,6 +5,7 @@ import { getSite, getStripeProduct, postBySlugService, + postsService, } from '@/services/serversideApi'; import { Post as PostModel, PostType } from '@/models/post.model'; @@ -437,7 +438,17 @@ export default function Post({ ); } -export async function getServerSideProps({ +export async function getStaticPaths(): Promise<{ + paths: { params: { type: PostType; slug: string } }[]; + fallback: boolean; +}> { + return { + paths: [], + fallback: true, + }; +} + +export async function getStaticProps({ params, }: { params: { coursePath: string }; @@ -449,6 +460,7 @@ export async function getServerSideProps({ source: Source | null; product: StripeProduct | null; }; + revalidate: number; } | { redirect: { destination: string; permanent: boolean } } | { notFound: boolean } @@ -531,5 +543,6 @@ export async function getServerSideProps({ source, product, }, + revalidate: 3600, }; }