@stackfactor/client-api 1.1.124 → 1.1.126
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/skillAssessments.js +26 -0
- package/package.json +1 -1
package/lib/skillAssessments.js
CHANGED
|
@@ -109,6 +109,31 @@ const getById = (id, token) => {
|
|
|
109
109
|
});
|
|
110
110
|
};
|
|
111
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Get skill assessment by user and skill
|
|
114
|
+
* @param {String} userId
|
|
115
|
+
* @param {String} skillId
|
|
116
|
+
* @param {String} token
|
|
117
|
+
* @returns {Promise<Object>} The skill assessment
|
|
118
|
+
*/
|
|
119
|
+
const getByUserAndSkill = (userId, skillId, token) => {
|
|
120
|
+
return new Promise(function (resolve, reject) {
|
|
121
|
+
let confirmationRequest = client.get(
|
|
122
|
+
`api/v1/skillassessments/getbyuserandskill/${userId}/${skillId}`,
|
|
123
|
+
{
|
|
124
|
+
headers: { authorization: token },
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
confirmationRequest
|
|
128
|
+
.then((response) => {
|
|
129
|
+
resolve(response.data);
|
|
130
|
+
})
|
|
131
|
+
.catch((error) => {
|
|
132
|
+
reject(error);
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
|
|
112
137
|
/**
|
|
113
138
|
* Get list
|
|
114
139
|
* @param {Object} userId The user used to select the skill
|
|
@@ -140,5 +165,6 @@ export default {
|
|
|
140
165
|
create,
|
|
141
166
|
deleteSkillAssessment,
|
|
142
167
|
getById,
|
|
168
|
+
getByUserAndSkill,
|
|
143
169
|
getList,
|
|
144
170
|
};
|