Skip to content

Commit 1410318

Browse files
committed
TSJR-14 - update api endpoints for skills
1 parent 9d3106e commit 1410318

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { EnvironmentConfig } from '~/config'
22
import { UserSkill, xhrGetAsync, xhrPostAsync, xhrPutAsync } from '~/libs/core'
33

4-
const baseUrl = `${EnvironmentConfig.API.V5}/emsi-skills/member-emsi-skills`
4+
const baseUrl = `${EnvironmentConfig.API.V5}/standardized-skills`
55

66
export async function autoCompleteSkills(queryTerm: string): Promise<UserSkill[]> {
77
if (!queryTerm) {
88
return Promise.resolve([])
99
}
1010

1111
const encodedQuery = encodeURIComponent(queryTerm)
12-
return xhrGetAsync(`${EnvironmentConfig.API.V5}/emsi-skills/skills/auto-complete?term=${encodedQuery}`)
12+
return xhrGetAsync(`${baseUrl}/skills/autocomplete?term=${encodedQuery}`)
1313
}
1414

1515
export type FetchMemberSkillsConfig = {
@@ -19,19 +19,18 @@ export async function fetchMemberSkills(
1919
userId: string | number | undefined,
2020
config: FetchMemberSkillsConfig,
2121
): Promise<UserSkill[]> {
22-
const url = `${baseUrl}/${userId}?pageFlag=${!config.skipPagination}`
22+
const url = `${baseUrl}/user-skills/${userId}?disablePagination=${config.skipPagination}`
2323
return xhrGetAsync(url)
2424
}
2525

2626
export async function createMemberSkills(userId: number, skills: UserSkill[]): Promise<void> {
27-
return xhrPostAsync(baseUrl, {
27+
return xhrPostAsync(`${baseUrl}/user-skills/${userId}`, {
2828
skills,
29-
userId,
3029
})
3130
}
3231

3332
export async function updateMemberSkills(userId: string | number, skills: UserSkill[]): Promise<void> {
34-
return xhrPutAsync(`${baseUrl}/${userId}`, {
33+
return xhrPutAsync(`${baseUrl}/user-skills/${userId}`, {
3534
skills,
3635
})
3736
}

0 commit comments

Comments
 (0)