File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
src-ts/tools/learn/course-details Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ const CourseDetailsPage: FC<{}> = () => {
48
48
const {
49
49
certificationProgress : progress ,
50
50
ready : progressReady ,
51
+ setCertificateProgress,
51
52
} : UserCertificationProgressProviderData = useGetUserCertificationProgress (
52
53
profile ?. userId ,
53
54
routeParams . provider ,
@@ -214,6 +215,7 @@ const CourseDetailsPage: FC<{}> = () => {
214
215
progress = { progress }
215
216
progressReady = { progressReady }
216
217
profile = { profile }
218
+ setCertificateProgress = { setCertificateProgress }
217
219
/>
218
220
</ div >
219
221
</ div >
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ interface CourseCurriculumProps {
31
31
profile ?: UserProfile
32
32
progress ?: LearnUserCertificationProgress
33
33
progressReady ?: boolean
34
+ setCertificateProgress : ( d : LearnUserCertificationProgress ) => void
34
35
}
35
36
36
37
const CourseCurriculum : FC < CourseCurriculumProps > = ( props : CourseCurriculumProps ) => {
@@ -108,7 +109,7 @@ const CourseCurriculum: FC<CourseCurriculumProps> = (props: CourseCurriculumProp
108
109
}
109
110
110
111
if ( ! props . progress ?. id ) {
111
- await userCertificationProgressStartAsync (
112
+ const progress : LearnUserCertificationProgress = await userCertificationProgressStartAsync (
112
113
props . profile . userId ,
113
114
props . course . certificationId ,
114
115
props . course . id ,
@@ -117,6 +118,9 @@ const CourseCurriculum: FC<CourseCurriculumProps> = (props: CourseCurriculumProp
117
118
module : props . course . modules [ 0 ] . meta . dashedName ,
118
119
} ,
119
120
)
121
+
122
+ // update progress with data returned from calling the start progress endpoint
123
+ props . setCertificateProgress ( progress )
120
124
} else {
121
125
await userCertificationProgressUpdateAsync (
122
126
props . progress . id ,
You can’t perform that action at this time.
0 commit comments