@stackfactor/client-api 1.1.1 → 1.1.3
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/constants.js +1 -0
- package/lib/learningContent.js +39 -0
- package/package.json +1 -1
package/lib/constants.js
CHANGED
|
@@ -80,6 +80,7 @@ const PERMISSIONS = {
|
|
|
80
80
|
ADMIN_PROMOTE_CONTENT: "5ea3d10bea252025c8ec351b",
|
|
81
81
|
ADMIN_MANAGE_CONTENT_PROVIDERS: "61970935cee185acf08111f6",
|
|
82
82
|
AUTHOR_CONTENT: "5fac210560e43de7c6b4a208",
|
|
83
|
+
BETA_TESTER: "5fac210b6c8f874bd7137b97",
|
|
83
84
|
MANAGE_BILLING: "5e1570cd03f676213bfdcd08",
|
|
84
85
|
MANAGE_CONTENT_PROVIDERS: "5f0fa12f16a720fde58ea820",
|
|
85
86
|
MANAGE_GROUPS: "5dd612fe59e518ac87b8cf8e",
|
package/lib/learningContent.js
CHANGED
|
@@ -199,6 +199,44 @@ export const setLearningContentInformation = (id, data, token) => {
|
|
|
199
199
|
});
|
|
200
200
|
};
|
|
201
201
|
|
|
202
|
+
/**
|
|
203
|
+
* Set the content for a specific learning activity
|
|
204
|
+
* @param {String} id
|
|
205
|
+
* @param {String} learningActivityId
|
|
206
|
+
* @param {String} operation
|
|
207
|
+
* @param {Object} data
|
|
208
|
+
* @param {String} token
|
|
209
|
+
* @returns {Promise<String>} OK word if the operation was succesful
|
|
210
|
+
*/
|
|
211
|
+
export const setLearningActivityInformation = (
|
|
212
|
+
id,
|
|
213
|
+
learningActivityId,
|
|
214
|
+
operation,
|
|
215
|
+
data,
|
|
216
|
+
token
|
|
217
|
+
) => {
|
|
218
|
+
return new Promise(function (resolve, reject) {
|
|
219
|
+
const requestData = {
|
|
220
|
+
data: data,
|
|
221
|
+
operation: operation,
|
|
222
|
+
};
|
|
223
|
+
let confirmationRequest = client.post(
|
|
224
|
+
`api/v1/learningcontent/updateactivity/${id}/${learningActivityId}`,
|
|
225
|
+
requestData,
|
|
226
|
+
{
|
|
227
|
+
headers: { authorization: token },
|
|
228
|
+
}
|
|
229
|
+
);
|
|
230
|
+
confirmationRequest
|
|
231
|
+
.then((response) => {
|
|
232
|
+
resolve(response.data);
|
|
233
|
+
})
|
|
234
|
+
.catch((error) => {
|
|
235
|
+
reject(error);
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
};
|
|
239
|
+
|
|
202
240
|
/**
|
|
203
241
|
* Update the learning content tags
|
|
204
242
|
* @param {String} id The id of the learning to be updated
|
|
@@ -264,6 +302,7 @@ const learningContent = {
|
|
|
264
302
|
getLearningContentInformationById,
|
|
265
303
|
getLearningContentList,
|
|
266
304
|
publishLearningContent,
|
|
305
|
+
setLearningActivityInformation,
|
|
267
306
|
setLearningContentInformation,
|
|
268
307
|
setLearningContentTags,
|
|
269
308
|
watchLearningContent,
|