musora-content-services 2.28.4 → 2.28.5
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 +7 -0
- package/package.json +1 -1
- package/src/services/imageSRCVerify.js +0 -0
- package/src/services/sanity.js +10 -5
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.28.5](https://github.com/railroadmedia/musora-content-services/compare/v2.28.4...v2.28.5) (2025-07-25)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **nullcheck:** patch for null sanity results and null check in relatedByLicense ([#382](https://github.com/railroadmedia/musora-content-services/issues/382)) ([05a3e06](https://github.com/railroadmedia/musora-content-services/commit/05a3e068d19cac244eda52203e124f6e8603bdf6))
|
|
11
|
+
|
|
5
12
|
### [2.28.4](https://github.com/railroadmedia/musora-content-services/compare/v2.28.3...v2.28.4) (2025-07-25)
|
|
6
13
|
|
|
7
14
|
### [2.28.3](https://github.com/railroadmedia/musora-content-services/compare/v2.28.2...v2.28.3) (2025-07-25)
|
package/package.json
CHANGED
|
File without changes
|
package/src/services/sanity.js
CHANGED
|
@@ -565,15 +565,17 @@ export async function fetchContentRows(brand, pageName, contentRowSlug)
|
|
|
565
565
|
if (pageName === 'lessons') pageName = 'lesson'
|
|
566
566
|
if (pageName === 'songs') pageName = 'song'
|
|
567
567
|
const rowString = contentRowSlug ? ` && slug.current == "${contentRowSlug.toLowerCase()}"` : ''
|
|
568
|
-
|
|
568
|
+
const childFilter = await new FilterBuilder('', {isChildrenFilter: true}).buildFilter()
|
|
569
|
+
const query = `*[_type == 'recommended-content-row' && brand == '${brand}' && type == '${pageName}'${rowString}]{
|
|
569
570
|
brand,
|
|
570
571
|
name,
|
|
571
572
|
'slug': slug.current,
|
|
572
|
-
'content': content[]->{
|
|
573
|
-
'children': child[]->{ 'id': railcontent_id, 'children': child[]->{'id': railcontent_id}, },
|
|
573
|
+
'content': content[${childFilter}]->{
|
|
574
|
+
'children': child[${childFilter}]->{ 'id': railcontent_id, 'children': child[${childFilter}]->{'id': railcontent_id}, },
|
|
574
575
|
${getFieldsForContentType('tab-data')}
|
|
575
576
|
},
|
|
576
|
-
}
|
|
577
|
+
}`
|
|
578
|
+
return fetchSanity(query, true)
|
|
577
579
|
}
|
|
578
580
|
|
|
579
581
|
|
|
@@ -1265,7 +1267,7 @@ async function fetchRelatedByLicense(railcontentId, brand, onlyUseSongTypes, cou
|
|
|
1265
1267
|
*[${filterSongTypesWithSameLicense}]->{${queryFields}}|order(published_on desc, title asc)[0...${count}],
|
|
1266
1268
|
}[0...1]`
|
|
1267
1269
|
const results = await fetchSanity(query, false)
|
|
1268
|
-
return results['related_by_license'] ?? []
|
|
1270
|
+
return results ? results['related_by_license'] ?? [] : []
|
|
1269
1271
|
}
|
|
1270
1272
|
|
|
1271
1273
|
/**
|
|
@@ -1862,6 +1864,9 @@ export async function fetchSanity(
|
|
|
1862
1864
|
console.log('fetchSanity Results:', result)
|
|
1863
1865
|
}
|
|
1864
1866
|
let results = isList ? result.result : result.result[0]
|
|
1867
|
+
if (!results) {
|
|
1868
|
+
throw new Error('No results found')
|
|
1869
|
+
}
|
|
1865
1870
|
results = processNeedAccess
|
|
1866
1871
|
? await needsAccessDecorator(results, userPermissions, isAdmin)
|
|
1867
1872
|
: results
|