@stackfactor/client-api 1.0.31 → 1.0.33
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/index.js +0 -2
- package/lib/actionNotifications.js +202 -226
- package/lib/address.js +21 -27
- package/lib/axiosClient.js +58 -64
- package/lib/config.js +62 -66
- package/lib/dashboard.js +64 -68
- package/lib/departmentTrainingPlans.js +159 -153
- package/lib/groups.js +266 -291
- package/lib/integration.js +307 -312
- package/lib/integrationConfiguration.js +96 -90
- package/lib/integrations/contentGenerator.js +71 -74
- package/lib/learningContent.js +239 -240
- package/lib/logger.js +51 -56
- package/lib/role.js +238 -245
- package/lib/roleTemplate.js +247 -255
- package/lib/skill.js +299 -311
- package/lib/skillAssessmentTestingSession.js +132 -137
- package/lib/skillAssessments.js +125 -129
- package/lib/skillTemplate.js +250 -255
- package/lib/teams.js +261 -257
- package/lib/tenants.js +48 -52
- package/lib/trainingPlanTemplate.js +203 -202
- package/lib/trainingPlans.js +249 -251
- package/lib/userInformation.js +97 -85
- package/lib/users.js +557 -555
- package/lib/utils.js +38 -42
- package/package.json +1 -1
- package/lib/templates.js +0 -148
package/lib/skill.js
CHANGED
|
@@ -1,337 +1,325 @@
|
|
|
1
|
-
import
|
|
1
|
+
import axios from "./axiosClient";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Create skill and set information
|
|
5
|
+
* @param {Object} data
|
|
6
|
+
* @param {String} token Authorization token
|
|
7
|
+
*/
|
|
8
|
+
export const createSkill = (data, token) => {
|
|
9
|
+
return new Promise(function (resolve, reject) {
|
|
10
|
+
let confirmationRequest = axios.put(
|
|
11
|
+
"api/v1/skills",
|
|
12
|
+
{ data: data },
|
|
13
|
+
{
|
|
14
|
+
headers: { authorization: token },
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
confirmationRequest
|
|
18
|
+
.then((response) => {
|
|
19
|
+
resolve(response.data);
|
|
20
|
+
})
|
|
21
|
+
.catch((error) => {
|
|
22
|
+
reject(error);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
};
|
|
5
26
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Create skills from templates
|
|
29
|
+
* @param {Array<String>} templateIds,
|
|
30
|
+
* @param {String} token Authorization token
|
|
31
|
+
*/
|
|
32
|
+
export const createSkillsFromTemplates = (templateIds, token) => {
|
|
33
|
+
return new Promise(function (resolve, reject) {
|
|
34
|
+
const requestData = {
|
|
35
|
+
templateIds: templateIds,
|
|
36
|
+
};
|
|
37
|
+
let confirmationRequest = axios.put(
|
|
38
|
+
"api/v1/skills/createfromtemplate/",
|
|
39
|
+
requestData,
|
|
40
|
+
{
|
|
41
|
+
headers: { authorization: token },
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
confirmationRequest
|
|
45
|
+
.then((response) => {
|
|
46
|
+
resolve(response.data);
|
|
47
|
+
})
|
|
48
|
+
.catch((error) => {
|
|
49
|
+
reject(error);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Delete skill
|
|
56
|
+
* @param {String} id The id of the skill to be deleted
|
|
57
|
+
* @param {String} comment The comment included with the deletion
|
|
58
|
+
* @param {String} token Authorization token
|
|
59
|
+
*/
|
|
60
|
+
export const deleteSkill = (id, comment, token) => {
|
|
61
|
+
return new Promise(function (resolve, reject) {
|
|
62
|
+
const data = {
|
|
63
|
+
id: id,
|
|
64
|
+
};
|
|
65
|
+
if (comment) data.comment = comment;
|
|
66
|
+
const request = axios.delete(`api/v1/skills/`, {
|
|
67
|
+
headers: { authorization: token },
|
|
68
|
+
data: data,
|
|
27
69
|
});
|
|
28
|
-
|
|
70
|
+
request
|
|
71
|
+
.then((response) => {
|
|
72
|
+
resolve(response.data);
|
|
73
|
+
})
|
|
74
|
+
.catch((error) => {
|
|
75
|
+
reject(error);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
};
|
|
29
79
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
"api/v1/skills/createfromtemplate/",
|
|
42
|
-
requestData,
|
|
43
|
-
{
|
|
44
|
-
headers: { authorization: token },
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
confirmationRequest
|
|
48
|
-
.then((response) => {
|
|
49
|
-
resolve(response.data);
|
|
50
|
-
})
|
|
51
|
-
.catch((error) => {
|
|
52
|
-
reject(error);
|
|
53
|
-
});
|
|
80
|
+
/**
|
|
81
|
+
* Discard the skill draft changes
|
|
82
|
+
* @param {String} id The id of the skill to be deleted
|
|
83
|
+
* @param {String} token Authorization token
|
|
84
|
+
*/
|
|
85
|
+
export const discardSkillChanges = (id, token) => {
|
|
86
|
+
return new Promise(function (resolve, reject) {
|
|
87
|
+
const data = {};
|
|
88
|
+
const request = axios.get(`api/v1/skills/discard/${id}`, {
|
|
89
|
+
headers: { authorization: token },
|
|
90
|
+
data: data,
|
|
54
91
|
});
|
|
55
|
-
|
|
92
|
+
request
|
|
93
|
+
.then((response) => {
|
|
94
|
+
resolve(response.data);
|
|
95
|
+
})
|
|
96
|
+
.catch((error) => {
|
|
97
|
+
reject(error);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
};
|
|
56
101
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (comment) data.comment = comment;
|
|
69
|
-
const request = axios.delete(`api/v1/skills/`, {
|
|
102
|
+
/**
|
|
103
|
+
* Get the skill related roles
|
|
104
|
+
* @param {String} id
|
|
105
|
+
* @param {String} token
|
|
106
|
+
* @returns
|
|
107
|
+
*/
|
|
108
|
+
export const getSkillRelatedRoles = (id, token) => {
|
|
109
|
+
return new Promise(function (resolve, reject) {
|
|
110
|
+
let confirmationRequest = axios.get(
|
|
111
|
+
`api/v1/skills/getskillrelatedroles/${id}`,
|
|
112
|
+
{
|
|
70
113
|
headers: { authorization: token },
|
|
71
|
-
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
confirmationRequest
|
|
117
|
+
.then((response) => {
|
|
118
|
+
resolve(response.data);
|
|
119
|
+
})
|
|
120
|
+
.catch((error) => {
|
|
121
|
+
reject(error);
|
|
72
122
|
});
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
resolve(response.data);
|
|
76
|
-
})
|
|
77
|
-
.catch((error) => {
|
|
78
|
-
reject(error);
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
},
|
|
123
|
+
});
|
|
124
|
+
};
|
|
82
125
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
126
|
+
/**
|
|
127
|
+
* Get skill required assessment type
|
|
128
|
+
* @param {String} id
|
|
129
|
+
* @param {String} token
|
|
130
|
+
*/
|
|
131
|
+
export const getSkillRequiredAssessmentType = (id, token) => {
|
|
132
|
+
return new Promise(function (resolve, reject) {
|
|
133
|
+
let confirmationRequest = axios.get(
|
|
134
|
+
`api/v1/skills/getrequiredassessmenttype/${id}`,
|
|
135
|
+
{
|
|
92
136
|
headers: { authorization: token },
|
|
93
|
-
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
confirmationRequest
|
|
140
|
+
.then((response) => {
|
|
141
|
+
resolve(response.data);
|
|
142
|
+
})
|
|
143
|
+
.catch((error) => {
|
|
144
|
+
reject(error);
|
|
94
145
|
});
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
resolve(response.data);
|
|
98
|
-
})
|
|
99
|
-
.catch((error) => {
|
|
100
|
-
reject(error);
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Get the skill related roles
|
|
107
|
-
* @param {String} id
|
|
108
|
-
* @param {String} token
|
|
109
|
-
* @returns
|
|
110
|
-
*/
|
|
111
|
-
getSkillRelatedRoles: (id, token) => {
|
|
112
|
-
return new Promise(function (resolve, reject) {
|
|
113
|
-
let confirmationRequest = axios.get(
|
|
114
|
-
`api/v1/skills/getskillrelatedroles/${id}`,
|
|
115
|
-
{
|
|
116
|
-
headers: { authorization: token },
|
|
117
|
-
}
|
|
118
|
-
);
|
|
119
|
-
confirmationRequest
|
|
120
|
-
.then((response) => {
|
|
121
|
-
resolve(response.data);
|
|
122
|
-
})
|
|
123
|
-
.catch((error) => {
|
|
124
|
-
reject(error);
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
},
|
|
146
|
+
});
|
|
147
|
+
};
|
|
128
148
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
/**
|
|
150
|
+
* Get skill skill information
|
|
151
|
+
* @param {String} id The id of the skill
|
|
152
|
+
* @param {String} token Authorization token
|
|
153
|
+
*/
|
|
154
|
+
export const getSkillInformationById = (id, version, token) => {
|
|
155
|
+
return new Promise(function (resolve, reject) {
|
|
156
|
+
let confirmationRequest = axios.get(
|
|
157
|
+
`api/v1/skills/skill/${id}/${version}`,
|
|
158
|
+
{
|
|
159
|
+
headers: { authorization: token },
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
confirmationRequest
|
|
163
|
+
.then((response) => {
|
|
164
|
+
resolve(response.data);
|
|
165
|
+
})
|
|
166
|
+
.catch((error) => {
|
|
167
|
+
reject(error);
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
};
|
|
151
171
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
+
/**
|
|
173
|
+
* Get skill list
|
|
174
|
+
* @param {Array<String>} filter The filter used to select the skill
|
|
175
|
+
* @param {String} version The version to be retrieved
|
|
176
|
+
* @param {Boolean} includeDeleted If true it will return deleted records as well
|
|
177
|
+
* @param {Boolean} returnDefaultIfVersionNotAvailable Return the default version if published not available
|
|
178
|
+
* @param {String} token Authorization token
|
|
179
|
+
*/
|
|
180
|
+
export const getSkillList = (
|
|
181
|
+
filter,
|
|
182
|
+
version,
|
|
183
|
+
includeDeleted,
|
|
184
|
+
returnDefaultIfVersionNotAvailable,
|
|
185
|
+
token
|
|
186
|
+
) => {
|
|
187
|
+
return new Promise(function (resolve, reject) {
|
|
188
|
+
const requestData = {
|
|
189
|
+
version: version,
|
|
190
|
+
includeDeleted: includeDeleted,
|
|
191
|
+
returnDefaultIfVersionNotAvailable: returnDefaultIfVersionNotAvailable,
|
|
192
|
+
};
|
|
193
|
+
if (filter) requestData.filter = filter;
|
|
194
|
+
let confirmationRequest = axios.post(`api/v1/skills`, requestData, {
|
|
195
|
+
headers: { authorization: token },
|
|
172
196
|
});
|
|
173
|
-
|
|
197
|
+
confirmationRequest
|
|
198
|
+
.then((response) => {
|
|
199
|
+
resolve(response.data);
|
|
200
|
+
})
|
|
201
|
+
.catch((error) => {
|
|
202
|
+
reject(error);
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
};
|
|
174
206
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
includeDeleted,
|
|
187
|
-
returnDefaultIfVersionNotAvailable,
|
|
188
|
-
token
|
|
189
|
-
) => {
|
|
190
|
-
return new Promise(function (resolve, reject) {
|
|
191
|
-
const requestData = {
|
|
192
|
-
version: version,
|
|
193
|
-
includeDeleted: includeDeleted,
|
|
194
|
-
returnDefaultIfVersionNotAvailable: returnDefaultIfVersionNotAvailable,
|
|
195
|
-
};
|
|
196
|
-
if (filter) requestData.filter = filter;
|
|
197
|
-
let confirmationRequest = axios.post(`api/v1/skills`, requestData, {
|
|
207
|
+
/**
|
|
208
|
+
* Get skills for team by id
|
|
209
|
+
* @param {String} teamId The ID of the team for which skills will be loaded
|
|
210
|
+
* @param {Number} maxDepth How many levels down in the organization the skills will be loaded
|
|
211
|
+
* @param {String} token Authorization token
|
|
212
|
+
*/
|
|
213
|
+
export const getTeamSkillsById = (teamId, maxDepth, token) => {
|
|
214
|
+
return new Promise(function (resolve, reject) {
|
|
215
|
+
let confirmationRequest = axios.get(
|
|
216
|
+
`api/v1/skills/getteambyid/${teamId}/${maxDepth}`,
|
|
217
|
+
{
|
|
198
218
|
headers: { authorization: token },
|
|
219
|
+
}
|
|
220
|
+
);
|
|
221
|
+
confirmationRequest
|
|
222
|
+
.then((response) => {
|
|
223
|
+
resolve(response.data);
|
|
224
|
+
})
|
|
225
|
+
.catch((error) => {
|
|
226
|
+
reject(error);
|
|
199
227
|
});
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
resolve(response.data);
|
|
203
|
-
})
|
|
204
|
-
.catch((error) => {
|
|
205
|
-
reject(error);
|
|
206
|
-
});
|
|
207
|
-
});
|
|
208
|
-
},
|
|
228
|
+
});
|
|
229
|
+
};
|
|
209
230
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
{
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
},
|
|
231
|
+
/**
|
|
232
|
+
* Get current user team skills
|
|
233
|
+
* @param {Number} maxDepth How many levels down in the organization the skills will be loaded
|
|
234
|
+
* @param {String} token Authorization token
|
|
235
|
+
*/
|
|
236
|
+
export const getCurrentUserTeamSkills = (maxDepth, token) => {
|
|
237
|
+
return new Promise(function (resolve, reject) {
|
|
238
|
+
let confirmationRequest = axios.get(
|
|
239
|
+
`api/v1/skills/getcurrentuserteam/${maxDepth}`,
|
|
240
|
+
{
|
|
241
|
+
headers: { authorization: token },
|
|
242
|
+
}
|
|
243
|
+
);
|
|
244
|
+
confirmationRequest
|
|
245
|
+
.then((response) => {
|
|
246
|
+
resolve(response.data);
|
|
247
|
+
})
|
|
248
|
+
.catch((error) => {
|
|
249
|
+
reject(error);
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
};
|
|
233
253
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
);
|
|
247
|
-
confirmationRequest
|
|
248
|
-
.then((response) => {
|
|
249
|
-
resolve(response.data);
|
|
250
|
-
})
|
|
251
|
-
.catch((error) => {
|
|
252
|
-
reject(error);
|
|
253
|
-
});
|
|
254
|
+
/**
|
|
255
|
+
* Publish skill
|
|
256
|
+
* @param {String} id The id of the skill to be published
|
|
257
|
+
* @param {String} comment The comment to be include with the request
|
|
258
|
+
* @param {String} token Authorization token
|
|
259
|
+
*/
|
|
260
|
+
export const publishSkill = (id, comment, token) => {
|
|
261
|
+
return new Promise(function (resolve, reject) {
|
|
262
|
+
let data = {};
|
|
263
|
+
if (comment) data.comment = comment;
|
|
264
|
+
let confirmationRequest = axios.post(`api/v1/skills/publish/${id}`, data, {
|
|
265
|
+
headers: { authorization: token },
|
|
254
266
|
});
|
|
255
|
-
|
|
267
|
+
confirmationRequest
|
|
268
|
+
.then((response) => {
|
|
269
|
+
resolve(response.data);
|
|
270
|
+
})
|
|
271
|
+
.catch((error) => {
|
|
272
|
+
reject(error);
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
};
|
|
256
276
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
headers: { authorization: token },
|
|
272
|
-
}
|
|
273
|
-
);
|
|
274
|
-
confirmationRequest
|
|
275
|
-
.then((response) => {
|
|
276
|
-
resolve(response.data);
|
|
277
|
-
})
|
|
278
|
-
.catch((error) => {
|
|
279
|
-
reject(error);
|
|
280
|
-
});
|
|
277
|
+
/**
|
|
278
|
+
* Set skill information
|
|
279
|
+
* @param {String} id The id of the skill to be updated
|
|
280
|
+
* @param {Object} data Data used to update the skill
|
|
281
|
+
* @param {String} token Authorization token
|
|
282
|
+
*/
|
|
283
|
+
export const setSkillInformation = (id, data, token) => {
|
|
284
|
+
return new Promise(function (resolve, reject) {
|
|
285
|
+
const requestData = {
|
|
286
|
+
data: data,
|
|
287
|
+
id: id,
|
|
288
|
+
};
|
|
289
|
+
let confirmationRequest = axios.post(`api/v1/skills/update/`, requestData, {
|
|
290
|
+
headers: { authorization: token },
|
|
281
291
|
});
|
|
282
|
-
|
|
292
|
+
confirmationRequest
|
|
293
|
+
.then((response) => {
|
|
294
|
+
resolve(response.data);
|
|
295
|
+
})
|
|
296
|
+
.catch((error) => {
|
|
297
|
+
reject(error);
|
|
298
|
+
});
|
|
299
|
+
});
|
|
300
|
+
};
|
|
283
301
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
requestData,
|
|
299
|
-
{
|
|
300
|
-
headers: { authorization: token },
|
|
301
|
-
}
|
|
302
|
-
);
|
|
303
|
-
confirmationRequest
|
|
304
|
-
.then((response) => {
|
|
305
|
-
resolve(response.data);
|
|
306
|
-
})
|
|
307
|
-
.catch((error) => {
|
|
308
|
-
reject(error);
|
|
309
|
-
});
|
|
302
|
+
/**
|
|
303
|
+
* Watch skill
|
|
304
|
+
* @param {String} id The id of the skill to be updated
|
|
305
|
+
* @param {Boolean} watch Set to true or false
|
|
306
|
+
* @param {String} token Authorization token
|
|
307
|
+
*/
|
|
308
|
+
export const watchSkill = (id, watch, token) => {
|
|
309
|
+
return new Promise(function (resolve, reject) {
|
|
310
|
+
const requestData = {
|
|
311
|
+
id: id,
|
|
312
|
+
watch: watch,
|
|
313
|
+
};
|
|
314
|
+
let confirmationRequest = axios.post(`api/v1/skills/watch`, requestData, {
|
|
315
|
+
headers: { authorization: token },
|
|
310
316
|
});
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
* @param {String} token Authorization token
|
|
318
|
-
*/
|
|
319
|
-
watchSkill: (id, watch, token) => {
|
|
320
|
-
return new Promise(function (resolve, reject) {
|
|
321
|
-
const requestData = {
|
|
322
|
-
id: id,
|
|
323
|
-
watch: watch,
|
|
324
|
-
};
|
|
325
|
-
let confirmationRequest = axios.post(`api/v1/skills/watch`, requestData, {
|
|
326
|
-
headers: { authorization: token },
|
|
317
|
+
confirmationRequest
|
|
318
|
+
.then((response) => {
|
|
319
|
+
resolve(response.data);
|
|
320
|
+
})
|
|
321
|
+
.catch((error) => {
|
|
322
|
+
reject(error);
|
|
327
323
|
});
|
|
328
|
-
|
|
329
|
-
.then((response) => {
|
|
330
|
-
resolve(response.data);
|
|
331
|
-
})
|
|
332
|
-
.catch((error) => {
|
|
333
|
-
reject(error);
|
|
334
|
-
});
|
|
335
|
-
});
|
|
336
|
-
},
|
|
324
|
+
});
|
|
337
325
|
};
|