musora-content-services 2.107.7 → 2.107.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [2.107.8](https://github.com/railroadmedia/musora-content-services/compare/v2.107.7...v2.107.8) (2025-12-30)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **T3PS-1289:** navigateTo calculation ([#677](https://github.com/railroadmedia/musora-content-services/issues/677)) ([12f4ca3](https://github.com/railroadmedia/musora-content-services/commit/12f4ca38b05a2175b33a9260e7c00f9aebfb8a87))
11
+
5
12
  ### [2.107.7](https://github.com/railroadmedia/musora-content-services/compare/v2.107.6...v2.107.7) (2025-12-29)
6
13
 
7
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "2.107.7",
3
+ "version": "2.107.8",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -364,13 +364,13 @@ export async function completeMethodIntroVideo(
364
364
  ): Promise<completeMethodIntroVideo> {
365
365
  let response = {} as completeMethodIntroVideo
366
366
 
367
- response.intro_video_response = await completeIfNotCompleted(introVideoId)
368
-
369
367
  const methodStructure = await fetchMethodV2Structure(brand)
370
- const firstLearningPathId = methodStructure.learning_paths[0].id
371
368
 
369
+ const firstLearningPathId = methodStructure.learning_paths[0].id
372
370
  response.active_path_response = await methodIntroVideoCompleteActions(brand, firstLearningPathId, getToday())
373
371
 
372
+ response.intro_video_response = await completeIfNotCompleted(introVideoId)
373
+
374
374
  return response
375
375
  }
376
376
 
@@ -408,17 +408,16 @@ export async function completeLearningPathIntroVideo(
408
408
  ) {
409
409
  let response = {} as completeLearningPathIntroVideo
410
410
 
411
- response.intro_video_response = await completeIfNotCompleted(introVideoId)
412
-
413
411
  const collection: CollectionObject = { id: learningPathId, type: COLLECTION_TYPE.LEARNING_PATH }
414
412
 
415
413
  if (!lessonsToImport) {
416
- response.learning_path_reset_response = await resetIfPossible(learningPathId, collection)
417
414
 
415
+ response.learning_path_reset_response = await resetIfPossible(learningPathId, collection)
418
416
  } else {
419
- response.lesson_import_response = await contentStatusCompletedMany(lessonsToImport, collection)
420
417
 
418
+ response.lesson_import_response = await contentStatusCompletedMany(lessonsToImport, collection)
421
419
  const activePath = await getActivePath(brand)
420
+
422
421
  if (activePath.active_learning_path_id === learningPathId) {
423
422
  response.update_dailies_response = await updateDailySession(
424
423
  brand,
@@ -428,6 +427,8 @@ export async function completeLearningPathIntroVideo(
428
427
  }
429
428
  }
430
429
 
430
+ response.intro_video_response = await completeIfNotCompleted(introVideoId)
431
+
431
432
  return response
432
433
  }
433
434
 
@@ -45,8 +45,8 @@ export async function getNavigateToForMethod(data) {
45
45
 
46
46
  const {content, collection} = tuple
47
47
 
48
- const findFirstIncomplete = (progresses) =>
49
- Object.keys(progresses).find(id => progresses[id] !== STATE_COMPLETED) || null
48
+ const findFirstIncomplete = (ids, progresses) =>
49
+ ids.find(id => progresses[id] !== STATE_COMPLETED) || ids[0]
50
50
 
51
51
  const findChildById = (children, id) =>
52
52
  children?.find(child => child.id === Number(id)) || null
@@ -56,7 +56,7 @@ export async function getNavigateToForMethod(data) {
56
56
  if (childrenIds.length === 0) return null
57
57
 
58
58
  const progresses = await getProgressStateByIds(childrenIds, collection)
59
- const incompleteId = findFirstIncomplete(progresses)
59
+ const incompleteId = findFirstIncomplete(childrenIds, progresses)
60
60
 
61
61
  return incompleteId ? findChildById(content.children, incompleteId) : content.children[0]
62
62
  }
@@ -64,7 +64,7 @@ export async function getNavigateToForMethod(data) {
64
64
  const getDailySessionNavigateTo = async (content, dailySession, collection) => {
65
65
  const dailiesIds = dailySession?.map(item => item.content_ids).flat() || []
66
66
  const progresses = await getProgressStateByIds(dailiesIds, collection)
67
- const incompleteId = findFirstIncomplete(progresses)
67
+ const incompleteId = findFirstIncomplete(dailiesIds, progresses)
68
68
 
69
69
  return incompleteId ? findChildById(content.children, incompleteId) : null
70
70
  }