musora-content-services 1.0.26 → 1.0.27

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,8 @@
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
+ ### [1.0.27](https://github.com/railroadmedia/musora-content-services/compare/v1.0.26...v1.0.27) (2024-08-14)
6
+
5
7
  ### [1.0.26](https://github.com/railroadmedia/musora-content-services/compare/v1.0.25...v1.0.26) (2024-08-14)
6
8
 
7
9
  ### [1.0.25](https://github.com/railroadmedia/musora-content-services/compare/v1.0.24...v1.0.25) (2024-08-14)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -31,24 +31,28 @@ export async function fetchSongById(songId) {
31
31
  railcontent_id,
32
32
  "resources": resource[]{resource_url, resource_name},
33
33
  }`;
34
-
35
- const songData = await fetchSanity(query, false);
36
-
37
- // Fetch the completion state for the current song
38
- const currentSongComplete = await fetchCurrentSongComplete(songId);
39
-
40
- if (songData && currentSongComplete) {
41
- console.log('currentSongComplete', currentSongComplete);
42
- songData.completed = currentSongComplete.state !== "not started";
43
- songData.progress_percent = currentSongComplete.percent.toString();
44
- } else {
45
- console.log('no currentSongComplete', currentSongComplete);
34
+
35
+ try {
36
+ const songData = await fetchSanity(query, false);
37
+ const currentSongComplete = await fetchCurrentSongComplete(songId);
38
+
39
+ if (songData && currentSongComplete) {
40
+ console.log('currentSongComplete', currentSongComplete);
41
+ songData.completed = currentSongComplete.state !== "not started";
42
+ songData.progress_percent = currentSongComplete.percent.toString();
43
+ } else {
44
+ console.log('no currentSongComplete', currentSongComplete);
45
+ }
46
+
47
+ console.log('all songData', songData);
48
+ return songData;
49
+ } catch (error) {
50
+ console.error('Error fetching song by ID:', error);
51
+ return null;
46
52
  }
47
-
48
- console.log('all songData', songData)
49
- return songData;
50
53
  }
51
54
 
55
+
52
56
  /**
53
57
  * Fetch all artists with lessons available for a specific brand.
54
58
  *