File tree Expand file tree Collapse file tree
frontend/main/src/pages/course/[coursePath] Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 getSite ,
66 getStripeProduct ,
77 postBySlugService ,
8+ postsService ,
89} from '@/services/serversideApi' ;
910
1011import { 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}
You can’t perform that action at this time.
0 commit comments