File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
api/src/mitxonline/hooks/courses
main/src/app-pages/DashboardPage Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ const coursesQueries = {
3131 return coursesApi . apiV2CoursesList ( { ...opts , page : pageParam } ) . then ( ( res ) => res . data )
3232 } ,
3333 initialPageParam : 1 ,
34- getNextPageParam : ( lastPage , allPages , pageParam ) : number => {
35- return lastPage && lastPage . next ? ( pageParam ? pageParam + 1 : 1 ) : 1
34+ getNextPageParam : ( lastPage , allPages , pageParam ) : number | null => {
35+ return lastPage && lastPage . next ? ( pageParam ? pageParam + 1 : null ) : null
3636 } ,
3737 } ) ,
3838}
Original file line number Diff line number Diff line change @@ -257,7 +257,9 @@ const OrgProgramDisplay: React.FC<{
257257 < Skeleton width = "100%" height = "65px" style = { { marginBottom : "16px" } } />
258258 )
259259 if ( programLoading || courses . isLoading ) return skeleton
260- if ( ! courses . isLoading ) console . log ( courses . data )
260+
261+ if ( courses . hasNextPage && ! courses . isFetching ) courses . fetchNextPage ( )
262+
261263 const transformedCourses = transform . mitxonlineOrgCourses ( {
262264 courses : ( ( ) => {
263265 let courseData : Array < CourseWithCourseRunsSerializerV2 > = [ ]
You can’t perform that action at this time.
0 commit comments