musora-content-services 1.3.9 → 1.3.10

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.
File without changes
File without changes
File without changes
File without changes
package/jest.config.js CHANGED
File without changes
package/jsdoc.json CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "1.3.9",
3
+ "version": "1.3.10",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1253,11 +1253,22 @@ export async function fetchLessonContent(railContentId) {
1253
1253
  "type": *[railcontent_id == ^.id][0]._type,
1254
1254
  },
1255
1255
  sort,
1256
- xp`
1256
+ xp,
1257
+ stbs,ds2stbs, bdsStbs`
1257
1258
  const query = await buildQuery(`railcontent_id == ${railContentId}`, filterParams, fields, {
1258
1259
  isSingle: true,
1259
1260
  })
1260
- return fetchSanity(query, false)
1261
+ const chapterProcess = (result) => {
1262
+ const chapters = result.chapters ?? [];
1263
+ if(chapters.length == 0) return result
1264
+ result.chapters = chapters.map((chapter, index) => ({
1265
+ ...chapter,
1266
+ chapter_thumbnail_url: `https://musora-web-platform.s3.amazonaws.com/chapters/${result.brand}/Chapter${index + 1}.jpg`
1267
+ }));
1268
+ return result
1269
+ }
1270
+
1271
+ return fetchSanity(query, false, {customPostProcess:chapterProcess})
1261
1272
  }
1262
1273
 
1263
1274
  /**
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/test/log.js CHANGED
File without changes
File without changes
File without changes
File without changes