musora-content-services 1.0.91 → 1.0.93
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 +4 -0
- package/package.json +1 -1
- package/src/index.js +2 -0
- package/src/services/railcontent.js +12 -6
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
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
|
+
### [1.0.93](https://github.com/railroadmedia/musora-content-services/compare/v1.0.92...v1.0.93) (2024-09-11)
|
|
6
|
+
|
|
7
|
+
### [1.0.92](https://github.com/railroadmedia/musora-content-services/compare/v1.0.91...v1.0.92) (2024-09-11)
|
|
8
|
+
|
|
5
9
|
### [1.0.91](https://github.com/railroadmedia/musora-content-services/compare/v1.0.90...v1.0.91) (2024-09-11)
|
|
6
10
|
|
|
7
11
|
### [1.0.90](https://github.com/railroadmedia/musora-content-services/compare/v1.0.89...v1.0.90) (2024-09-11)
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
fetchCompletedState,
|
|
42
42
|
fetchAllCompletedStates,
|
|
43
43
|
fetchContentInProgress,
|
|
44
|
+
fetchCompletedContent,
|
|
44
45
|
fetchVimeoData,
|
|
45
46
|
fetchContentPageUserData,
|
|
46
47
|
} from './services/railcontent.js';
|
|
@@ -77,6 +78,7 @@ export {
|
|
|
77
78
|
fetchCompletedState,
|
|
78
79
|
fetchAllCompletedStates,
|
|
79
80
|
fetchContentInProgress,
|
|
81
|
+
fetchCompletedContent,
|
|
80
82
|
fetchCourseOverview,
|
|
81
83
|
fetchChildren,
|
|
82
84
|
fetchParentByRailContentId,
|
|
@@ -142,15 +142,18 @@ export async function fetchSongsInProgress(brand) {
|
|
|
142
142
|
*
|
|
143
143
|
* @param {string} type - The content type associated with the content.
|
|
144
144
|
* @param {string} brand - The brand associated with the content.
|
|
145
|
-
* @param {number} [limit=20] - The limit of results per page.
|
|
146
|
-
* @param {number} [page=1] - The page number for pagination.
|
|
145
|
+
* @param {number} [params.limit=20] - The limit of results per page.
|
|
146
|
+
* @param {number} [params.page=1] - The page number for pagination.
|
|
147
147
|
* @returns {Promise<Object|null>} - Returns an object containing in-progress content if found, otherwise null.
|
|
148
148
|
* @example
|
|
149
149
|
* fetchContentInProgress('song', 'drumeo')
|
|
150
150
|
* .then(songs => console.log(songs))
|
|
151
151
|
* .catch(error => console.error(error));
|
|
152
152
|
*/
|
|
153
|
-
export async function fetchContentInProgress(type="all", brand,
|
|
153
|
+
export async function fetchContentInProgress(type="all", brand, {
|
|
154
|
+
page = 1,
|
|
155
|
+
limit = 10,
|
|
156
|
+
} = {}) {
|
|
154
157
|
let url;
|
|
155
158
|
if(type !== "all") {
|
|
156
159
|
url = `/content/in_progress/${globalConfig.railcontentConfig.userId}?brand=${brand}&limit=${limit}&page=${page}`;
|
|
@@ -181,15 +184,18 @@ export async function fetchContentInProgress(type="all", brand, limit=20, page=1
|
|
|
181
184
|
*
|
|
182
185
|
* @param {string} type - The content type associated with the content.
|
|
183
186
|
* @param {string} brand - The brand associated with the content.
|
|
184
|
-
* @param {number} [limit=20] - The limit of results per page.
|
|
185
|
-
* @param {number} [page=1] - The page number for pagination.
|
|
187
|
+
* @param {number} [params.limit=20] - The limit of results per page.
|
|
188
|
+
* @param {number} [params.page=1] - The page number for pagination.
|
|
186
189
|
* @returns {Promise<Object|null>} - Returns an object containing in-progress content if found, otherwise null.
|
|
187
190
|
* @example
|
|
188
191
|
* fetchCompletedContent('song', 'drumeo')
|
|
189
192
|
* .then(songs => console.log(songs))
|
|
190
193
|
* .catch(error => console.error(error));
|
|
191
194
|
*/
|
|
192
|
-
export async function fetchCompletedContent(type="all", brand,
|
|
195
|
+
export async function fetchCompletedContent(type="all", brand, {
|
|
196
|
+
page = 1,
|
|
197
|
+
limit = 10,
|
|
198
|
+
} = {}) {
|
|
193
199
|
let url;
|
|
194
200
|
if(type !== "all") {
|
|
195
201
|
url = `/content/completed/${globalConfig.railcontentConfig.userId}?brand=${brand}&limit=${limit}&page=${page}`;
|