Skip to content

Commit eb806a5

Browse files
author
Alex Patterson
authored
Merge pull request CodingCatDev#214 from CodingCatDev/feature/lesson-github-docs
change course to static
2 parents 0763452 + 9eee4b1 commit eb806a5

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

  • frontend/main/src/pages/course/[coursePath]

frontend/main/src/pages/course/[coursePath]/index.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
getSite,
66
getStripeProduct,
77
postBySlugService,
8+
postsService,
89
} from '@/services/serversideApi';
910

1011
import { Post as PostModel, PostType } from '@/models/post.model';
@@ -437,7 +438,17 @@ export default function Post({
437438
);
438439
}
439440

440-
export async function getServerSideProps({
441+
export async function getStaticPaths(): Promise<{
442+
paths: { params: { type: PostType; slug: string } }[];
443+
fallback: boolean;
444+
}> {
445+
return {
446+
paths: [],
447+
fallback: true,
448+
};
449+
}
450+
451+
export async function getStaticProps({
441452
params,
442453
}: {
443454
params: { coursePath: string };
@@ -449,6 +460,7 @@ export async function getServerSideProps({
449460
source: Source | null;
450461
product: StripeProduct | null;
451462
};
463+
revalidate: number;
452464
}
453465
| { redirect: { destination: string; permanent: boolean } }
454466
| { notFound: boolean }
@@ -531,5 +543,6 @@ export async function getServerSideProps({
531543
source,
532544
product,
533545
},
546+
revalidate: 3600,
534547
};
535548
}

0 commit comments

Comments
 (0)