@stackfactor/client-api 1.1.51 → 1.1.52
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/trainingPlans.js +19 -0
- package/package.json +1 -1
package/lib/trainingPlans.js
CHANGED
|
@@ -137,6 +137,24 @@ export const getTrainingPlanById = (id, version, token) => {
|
|
|
137
137
|
});
|
|
138
138
|
};
|
|
139
139
|
|
|
140
|
+
/**
|
|
141
|
+
* Get tasks summary for a recipient across all of the training plans
|
|
142
|
+
* @param {String} token Authorization token
|
|
143
|
+
*/
|
|
144
|
+
const getAllTrainingPlansTasksSummary = async (token = null) => {
|
|
145
|
+
return new Promise(function (resolve, reject) {
|
|
146
|
+
let confirmationRequest = client.get(`api/v1/trainingplans/taskssummary`, {
|
|
147
|
+
headers: token ? { authorization: token } : {},
|
|
148
|
+
});
|
|
149
|
+
confirmationRequest
|
|
150
|
+
.then((response) => {
|
|
151
|
+
resolve(response.data);
|
|
152
|
+
})
|
|
153
|
+
.catch((error) => {
|
|
154
|
+
reject(error);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
};
|
|
140
158
|
/**
|
|
141
159
|
* Get training plans list
|
|
142
160
|
* @param {Array<ObjectId>} users The list of users for which the plans should be loaded
|
|
@@ -295,6 +313,7 @@ export default {
|
|
|
295
313
|
deleteTrainingPlan,
|
|
296
314
|
discardTrainingPlanChanges,
|
|
297
315
|
generateNewBaseline,
|
|
316
|
+
getAllTrainingPlansTasksSummary,
|
|
298
317
|
getTrainingPlanById,
|
|
299
318
|
getListOfTrainingPlans,
|
|
300
319
|
publishTrainingPlan,
|