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<{}> = () => {
4848 const {
4949 certificationProgress : progress ,
5050 ready : progressReady ,
51+ setCertificateProgress,
5152 } : UserCertificationProgressProviderData = useGetUserCertificationProgress (
5253 profile ?. userId ,
5354 routeParams . provider ,
@@ -214,6 +215,7 @@ const CourseDetailsPage: FC<{}> = () => {
214215 progress = { progress }
215216 progressReady = { progressReady }
216217 profile = { profile }
218+ setCertificateProgress = { setCertificateProgress }
217219 />
218220 </ div >
219221 </ div >
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ interface CourseCurriculumProps {
3131 profile ?: UserProfile
3232 progress ?: LearnUserCertificationProgress
3333 progressReady ?: boolean
34+ setCertificateProgress : ( d : LearnUserCertificationProgress ) => void
3435}
3536
3637const CourseCurriculum : FC < CourseCurriculumProps > = ( props : CourseCurriculumProps ) => {
@@ -108,7 +109,7 @@ const CourseCurriculum: FC<CourseCurriculumProps> = (props: CourseCurriculumProp
108109 }
109110
110111 if ( ! props . progress ?. id ) {
111- await userCertificationProgressStartAsync (
112+ const progress : LearnUserCertificationProgress = await userCertificationProgressStartAsync (
112113 props . profile . userId ,
113114 props . course . certificationId ,
114115 props . course . id ,
@@ -117,6 +118,9 @@ const CourseCurriculum: FC<CourseCurriculumProps> = (props: CourseCurriculumProp
117118 module : props . course . modules [ 0 ] . meta . dashedName ,
118119 } ,
119120 )
121+
122+ // update progress with data returned from calling the start progress endpoint
123+ props . setCertificateProgress ( progress )
120124 } else {
121125 await userCertificationProgressUpdateAsync (
122126 props . progress . id ,
You can’t perform that action at this time.
0 commit comments