Skip to content

Commit

Permalink
Merge pull request #1762 from lumi-tip/development-lumi-8149
Browse files Browse the repository at this point in the history
♻️ include correct version on ep
  • Loading branch information
tommygonzaleza authored Jan 6, 2025
2 parents 6af99c7 + d2e7bcb commit 5aa9567
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/common/handlers/cohorts.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ export const getCohort = (id) => bc.admissions({ id }).cohorts()
export const getCohortSyllabus = (id) => getCohort(id)
.then(async (cohortData) => {
const syllabusSlug = cohortData?.syllabus_version?.slug;
const syllabusVersion = cohortData?.syllabus_version?.version;

try {
const resp = await bc.admissions().publicSyllabus(syllabusSlug);
const resp = await bc.admissions().publicSyllabus(syllabusSlug, syllabusVersion);
const data = await resp.json();
return {
syllabus: data,
Expand Down Expand Up @@ -155,6 +156,7 @@ export const processRelatedAssignments = (syllabusData = {}, taskTodo = []) => {
export const generateCohortSyllabusModules = async (id) => {
try {
const cohortAndSyllabus = await getCohortSyllabus(id);

const syllabusData = cohortAndSyllabus?.syllabus;
const cohortSyllabusList = syllabusData.json?.days || syllabusData.json?.modules;

Expand Down
2 changes: 1 addition & 1 deletion src/common/services/breathecode.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const breathecode = {
academy,
},
}),
publicSyllabus: (slug) => breathecode.get(`${url}/syllabus/${slug}/version/1${qs}`, {
publicSyllabus: (slug, version) => breathecode.get(`${url}/syllabus/${slug}/version/${version || '1'}${qs}`, {
headers: {
Authorization: `Token ${BC_ACADEMY_TOKEN}`,
academy: 4,
Expand Down

0 comments on commit 5aa9567

Please sign in to comment.