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 = {
31
31
return coursesApi . apiV2CoursesList ( { ...opts , page : pageParam } ) . then ( ( res ) => res . data )
32
32
} ,
33
33
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
36
36
} ,
37
37
} ) ,
38
38
}
Original file line number Diff line number Diff line change @@ -257,7 +257,9 @@ const OrgProgramDisplay: React.FC<{
257
257
< Skeleton width = "100%" height = "65px" style = { { marginBottom : "16px" } } />
258
258
)
259
259
if ( programLoading || courses . isLoading ) return skeleton
260
- if ( ! courses . isLoading ) console . log ( courses . data )
260
+
261
+ if ( courses . hasNextPage && ! courses . isFetching ) courses . fetchNextPage ( )
262
+
261
263
const transformedCourses = transform . mitxonlineOrgCourses ( {
262
264
courses : ( ( ) => {
263
265
let courseData : Array < CourseWithCourseRunsSerializerV2 > = [ ]
You can’t perform that action at this time.
0 commit comments