musora-content-services 2.70.2 → 2.71.0
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/contentTypeConfig.js +1 -0
- package/src/services/sanity.js +3 -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.71.0](https://github.com/railroadmedia/musora-content-services/compare/v2.70.2...v2.71.0) (2025-11-05)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* update children fields in fetchByRailContentId ([#544](https://github.com/railroadmedia/musora-content-services/issues/544)) ([8bdf7d6](https://github.com/railroadmedia/musora-content-services/commit/8bdf7d68b219f83a6e18fed439046e3ffca11642))
|
|
11
|
+
|
|
5
12
|
### [2.70.2](https://github.com/railroadmedia/musora-content-services/compare/v2.70.1...v2.70.2) (2025-11-05)
|
|
6
13
|
|
|
7
14
|
|
package/package.json
CHANGED
package/src/contentTypeConfig.js
CHANGED
package/src/services/sanity.js
CHANGED
|
@@ -440,13 +440,11 @@ export async function fetchScheduledReleases(brand, { page = 1, limit = 10 }) {
|
|
|
440
440
|
* .catch(error => console.error(error));
|
|
441
441
|
*/
|
|
442
442
|
export async function fetchByRailContentId(id, contentType) {
|
|
443
|
-
const fields = await getFieldsForContentTypeWithFilteredChildren(contentType)
|
|
444
|
-
const lessonFields = getChildFieldsForContentType(contentType)
|
|
443
|
+
const fields = await getFieldsForContentTypeWithFilteredChildren(contentType, true)
|
|
445
444
|
const childrenFilter = await new FilterBuilder(``, { isChildrenFilter: true }).buildFilter()
|
|
446
445
|
const entityFieldsString = ` ${fields}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
'length_in_seconds': coalesce(
|
|
446
|
+
'child_count': coalesce(count(child[${childrenFilter}]->), 0) ,
|
|
447
|
+
'length_in_seconds': coalesce(
|
|
450
448
|
math::sum(
|
|
451
449
|
select(
|
|
452
450
|
child[${childrenFilter}]->length_in_seconds
|