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.
- package/.prettierignore +0 -0
- package/.prettierrc +0 -0
- package/.yarnrc.yml +1 -0
- package/CHANGELOG.md +2 -0
- package/babel.config.cjs +0 -0
- package/docs/config.js.html +0 -0
- package/docs/global.html +809 -0
- package/docs/index.html +0 -0
- package/docs/module-Config.html +0 -0
- package/docs/module-Content-Services.html +763 -0
- package/docs/module-Railcontent-Services.html +0 -0
- package/docs/module-Sanity-Services.html +0 -0
- package/docs/railcontent.js.html +0 -0
- package/docs/sanity.js.html +0 -0
- package/jest.config.js +0 -0
- package/jsdoc.json +0 -0
- package/package.json +1 -1
- package/src/contentMetaData.js +0 -0
- package/src/services/config.js +0 -0
- package/src/services/contentLikes.js +0 -0
- package/src/services/contentProgress.js +0 -0
- package/src/services/lastUpdated.js +0 -0
- package/src/services/railcontent.js +0 -0
- package/src/services/sanity.js +13 -2
- package/src/services/userPermissions.js +0 -0
- package/test/contentLikes.test.js +0 -0
- package/test/contentProgress.test.js +0 -0
- package/test/initializeTests.js +0 -0
- package/test/lastUpdated.test.js +0 -0
- package/test/live/contentProgressLive.test.js +0 -0
- package/test/live/railcontentLive.test.js +0 -0
- package/test/localStorageMock.js +0 -0
- package/test/log.js +0 -0
- package/test/sanityQueryService.test.js +0 -0
- package/test/userPermissions.test.js +0 -0
- package/tools/generate-index.cjs +0 -0
|
File without changes
|
|
File without changes
|
package/docs/railcontent.js.html
CHANGED
|
File without changes
|
package/docs/sanity.js.html
CHANGED
|
File without changes
|
package/jest.config.js
CHANGED
|
File without changes
|
package/jsdoc.json
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/src/contentMetaData.js
CHANGED
|
File without changes
|
package/src/services/config.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/services/sanity.js
CHANGED
|
@@ -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
|
-
|
|
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
|
package/test/initializeTests.js
CHANGED
|
File without changes
|
package/test/lastUpdated.test.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/test/localStorageMock.js
CHANGED
|
File without changes
|
package/test/log.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/tools/generate-index.cjs
CHANGED
|
File without changes
|