File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed
mfes/scp-teacher-repo/src Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ const SessionCardFooter: React.FC<SessionCardFooterProps> = ({
131131 }
132132 ) ;
133133 courseData = response ?. result ?. data [ 0 ] ;
134- courseId = courseData . _id ;
134+ courseId = courseData ? ._id ;
135135 }
136136
137137 // let courseData = response?.result?.data[0];
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ export const getUserProjectTemplate = async ({
9090 solutionId,
9191 role,
9292 entityId,
93- acl
93+ acl,
9494} : GetUserProjectTemplateParams ) : Promise < any > => {
9595 const apiUrl : string = `${ process . env . NEXT_PUBLIC_COURSE_PLANNER_API_URL } /userProjects/details?templateId=${ templateId } &solutionId=${ solutionId } ` ;
9696
@@ -106,7 +106,7 @@ export const getUserProjectTemplate = async ({
106106 // scope: {}
107107 // },
108108 entityId,
109- acl
109+ acl,
110110 } ;
111111
112112 try {
@@ -145,7 +145,7 @@ export const UserStatusDetails = async ({
145145export const fetchCourseIdFromSolution = async (
146146 solutionId : string ,
147147 cohortId : string ,
148- acl :any
148+ acl : any
149149) : Promise < any > => {
150150 try {
151151 const solutionResponse = await getSolutionDetails ( {
@@ -154,15 +154,23 @@ export const fetchCourseIdFromSolution = async (
154154 } ) ;
155155
156156 const externalId = solutionResponse ?. result ?. externalId ;
157- let response = await getUserProjectTemplate ( {
157+ await getUserProjectTemplate ( {
158158 templateId : externalId ,
159159 solutionId,
160160 role : Role . TEACHER ,
161161 entityId : cohortId ,
162- acl
162+ acl,
163+ } ) ;
164+ const updatedResponse = await getTargetedSolutions ( {
165+ subject : acl ?. subject ,
166+ class : acl ?. class ,
167+ board : acl ?. board ,
168+ courseType : acl ?. courseType ,
169+ medium : acl ?. medium ,
170+ entityId : cohortId ,
163171 } ) ;
164172
165- return response ;
173+ return updatedResponse ;
166174 } catch ( error ) {
167175 console . error ( 'Error fetching solution details:' , error ) ;
168176 // throw error;
You can’t perform that action at this time.
0 commit comments