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 +2 -0
- package/package.json +1 -1
- package/src/services/sanity.js +19 -15
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
package/src/services/sanity.js
CHANGED
|
@@ -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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
*
|