Skip to content

Commit 6e0a75d

Browse files
authored
Merge pull request #2057 from rushi-tekdi/release-1.12.0
course planner fix
2 parents fef0d0e + 945bbb1 commit 6e0a75d

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

mfes/scp-teacher-repo/src/components/SessionCardFooter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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];

mfes/scp-teacher-repo/src/services/CoursePlannerService.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff 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 ({
145145
export 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;

0 commit comments

Comments
 (0)