@stackfactor/client-api 1.1.9 → 1.1.11
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/lib/learningContent.js +43 -10
- package/package.json +1 -1
package/lib/learningContent.js
CHANGED
|
@@ -94,16 +94,16 @@ export const generateLearningActivityContent = (
|
|
|
94
94
|
token
|
|
95
95
|
) => {
|
|
96
96
|
return new Promise(function (resolve, reject) {
|
|
97
|
-
const
|
|
97
|
+
const requestData = {
|
|
98
98
|
learningActivity: learningActivity,
|
|
99
99
|
microSkillId: microSkillId,
|
|
100
100
|
sections: sections,
|
|
101
101
|
};
|
|
102
102
|
const request = client.post(
|
|
103
103
|
`api/v1/learningcontent/generatelearningactivitycontent/${skillId}`,
|
|
104
|
+
requestData,
|
|
104
105
|
{
|
|
105
106
|
headers: { authorization: token },
|
|
106
|
-
data: data,
|
|
107
107
|
}
|
|
108
108
|
);
|
|
109
109
|
request
|
|
@@ -240,26 +240,58 @@ export const setLearningContentInformation = (id, data, token) => {
|
|
|
240
240
|
/**
|
|
241
241
|
* Set the content for a specific learning activity
|
|
242
242
|
* @param {String} id
|
|
243
|
-
* @param {String}
|
|
244
|
-
* @param {
|
|
243
|
+
* @param {String} learningcontentid
|
|
244
|
+
* @param {Object} data
|
|
245
|
+
* @param {String} token
|
|
246
|
+
* @returns {Promise<String>} OK word if the operation was succesful
|
|
247
|
+
*/
|
|
248
|
+
export const setLearningContentLearningContentInformation = (
|
|
249
|
+
id,
|
|
250
|
+
learningcontentid,
|
|
251
|
+
data,
|
|
252
|
+
token
|
|
253
|
+
) => {
|
|
254
|
+
return new Promise(function (resolve, reject) {
|
|
255
|
+
const requestData = {
|
|
256
|
+
data: data,
|
|
257
|
+
};
|
|
258
|
+
let confirmationRequest = client.post(
|
|
259
|
+
`api/v1/learningcontent/updatelearningcontent/${id}/${learningcontentid}`,
|
|
260
|
+
requestData,
|
|
261
|
+
{
|
|
262
|
+
headers: { authorization: token },
|
|
263
|
+
}
|
|
264
|
+
);
|
|
265
|
+
confirmationRequest
|
|
266
|
+
.then((response) => {
|
|
267
|
+
resolve(response.data);
|
|
268
|
+
})
|
|
269
|
+
.catch((error) => {
|
|
270
|
+
reject(error);
|
|
271
|
+
});
|
|
272
|
+
});
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Set all the learning content for a specific micro skill
|
|
277
|
+
* @param {String} id
|
|
278
|
+
* @param {String} microskillid
|
|
245
279
|
* @param {Object} data
|
|
246
280
|
* @param {String} token
|
|
247
281
|
* @returns {Promise<String>} OK word if the operation was succesful
|
|
248
282
|
*/
|
|
249
|
-
export const
|
|
283
|
+
export const setMicroSkillLearningContentInformation = (
|
|
250
284
|
id,
|
|
251
|
-
|
|
252
|
-
operation,
|
|
285
|
+
microskillid,
|
|
253
286
|
data,
|
|
254
287
|
token
|
|
255
288
|
) => {
|
|
256
289
|
return new Promise(function (resolve, reject) {
|
|
257
290
|
const requestData = {
|
|
258
291
|
data: data,
|
|
259
|
-
operation: operation,
|
|
260
292
|
};
|
|
261
293
|
let confirmationRequest = client.post(
|
|
262
|
-
`api/v1/learningcontent/
|
|
294
|
+
`api/v1/learningcontent/updatemicroskilllearningcontent/${id}/${microskillid}`,
|
|
263
295
|
requestData,
|
|
264
296
|
{
|
|
265
297
|
headers: { authorization: token },
|
|
@@ -341,7 +373,8 @@ const learningContent = {
|
|
|
341
373
|
generateLearningActivityContent,
|
|
342
374
|
getLearningContentList,
|
|
343
375
|
publishLearningContent,
|
|
344
|
-
|
|
376
|
+
setLearningContentLearningContentInformation,
|
|
377
|
+
setMicroSkillLearningContentInformation,
|
|
345
378
|
setLearningContentInformation,
|
|
346
379
|
setLearningContentTags,
|
|
347
380
|
watchLearningContent,
|