Skip to content

Commit

Permalink
BREAKING CHANGE: Fix skill update after upstream API change
Browse files Browse the repository at this point in the history
`level` must now be a number instead of allowing for strings, too. Previously the service method `updateSkillByEmail` used `string` instead of `string | number` -> be explicit about requiring `number` there, too.

`saveTo` is now a required key (use previous behaviour of always saving to the profile instead of resumes; value 5).
  • Loading branch information
mikkopiu committed Jan 18, 2024
1 parent ebb325f commit 2baa7f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ export class Api {
updateSkill = (
userId: number | string,
skillId: number | string,
keywordSynonymId: number | string,
level: number | string
keywordSynonymId: number,
level: number
) =>
this.client
.put(
Expand All @@ -358,6 +358,7 @@ export class Api {
json: {
keywordSynonymId,
level,
saveTo: 5, // CompanyUserProfileSkillEditModel > AllResumesOfLanguage = 3; Profile = 5;
},
}
)
Expand Down
2 changes: 1 addition & 1 deletion src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ export class CinodeService {
return { assigned, prospects, openRoles };
}

async updateSkillByEmail(email: string, skillName: string, level: string) {
async updateSkillByEmail(email: string, skillName: string, level: number) {
const userId = await this.api.resolveUserIdByEmail(email);
if (!userId) {
throw new Error(`No user found with email: ${email}`);
Expand Down

0 comments on commit 2baa7f9

Please sign in to comment.