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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "2.70.2",
3
+ "version": "2.71.0",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -426,6 +426,7 @@ export let contentTypeConfig = {
426
426
  content._ref == ^._id
427
427
  ][0].badge.asset->url`,
428
428
  ],
429
+ includeChildFields: true,
429
430
  },
430
431
  'learning-path-course': {
431
432
  fields: [
@@ -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
- 'child_count': coalesce(count(child[${childrenFilter}]->), 0) ,
448
- "lessons": child[${childrenFilter}]->{${lessonFields}},
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