Skip to content

Commit 972a8d8

Browse files
Nursoltan SaipoldaNursoltan Saipolda
Nursoltan Saipolda
authored and
Nursoltan Saipolda
committed
fix issue 5953
1 parent 473daea commit 972a8d8

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/services/members.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,22 @@ class MembersService {
187187
* @return {Promise} Resolves to operation result
188188
*/
189189
async addSkill(handle, skillTagId) {
190+
let res = {};
191+
const url = `/members/${handle}/skills`;
192+
const skills = await this.getSkills(handle);
193+
190194
const body = {
191195
[skillTagId]: {
192196
hidden: false,
193197
},
194198
};
195-
const res = await this.private.apiV5.patchJson(`/members/${handle}/skills`, body);
199+
200+
if (skills && skills.createdAt) {
201+
res = await this.private.apiV5.patchJson(url, body);
202+
} else {
203+
res = await this.private.apiV5.postJson(url, body);
204+
}
205+
196206
return handleApiResponse(res);
197207
}
198208

0 commit comments

Comments
 (0)