Skip to content

Commit c312d2e

Browse files
Update CoursePage to use courseData for fetching featured assets and plan slug, ensuring consistency in data handling.
1 parent c05257e commit c312d2e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/pages/bootcamp/[course_slug].jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ function CoursePage() {
299299
const assetTypeCount = { lesson: 0, project: 0, quiz: 0, exercise: 0 };
300300
const projects = [];
301301
const exercises = [];
302-
const featuredAssetSlugs = data?.course_translation?.featured_assets?.split(',') || [];
302+
const featuredAssetSlugs = courseData?.course_translation?.featured_assets?.split(',') || [];
303303
const language = lang === 'en' ? 'us' : lang;
304304

305305
cohortSyllabus?.syllabus?.modules?.forEach((module) => {
@@ -348,7 +348,8 @@ function CoursePage() {
348348
return { count: {}, assignmentList: [] };
349349
}
350350
};
351-
const formatedPlanData = await fetchSuggestedPlan(data?.plan_slug, translationsObj, 'mkt_plans', country_code).then((finalData) => finalData);
351+
352+
const formatedPlanData = await fetchSuggestedPlan(courseData?.plan_slug, translationsObj, 'mkt_plans', country_code).then((finalData) => finalData);
352353

353354
const modulesInfo = await getModulesInfo();
354355

@@ -364,7 +365,7 @@ function CoursePage() {
364365

365366
const instructorsList = await bc.cohort({
366367
roles: 'TEACHER,ASSISTANT',
367-
cohort_id: cohortId,
368+
cohort_id: courseData?.cohort?.id,
368369
}).getPublicMembers()
369370
.then((respMembers) => respMembers.data);
370371
const uniqueInstructors = instructorsList?.length > 0 ? instructorsList?.filter((instructor, index, self) => self.findIndex((l) => (

0 commit comments

Comments
 (0)