@stackfactor/client-api 1.1.2 → 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.
@@ -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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackfactor/client-api",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Node.js library for the StackFactor API",
5
5
  "main": "index.js",
6
6
  "exports": {