11import { EnvironmentConfig } from '~/config'
22import { 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
66export 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
1515export 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
2626export 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
3332export 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