Skip to content

Commit

Permalink
feat(api-client): implement v7 changes in the user api
Browse files Browse the repository at this point in the history
  • Loading branch information
V-Gira committed Dec 3, 2024
1 parent 009e706 commit aa441ef
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/api-client/src/user/UserAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ export class UserAPI {
const config: AxiosRequestConfig = {
data: handles,
method: 'post',
url: `${UserAPI.URL.USERS}/${UserAPI.URL.HANDLES}`,
url: this.backendFeatures.version >= 7 ? `${UserAPI.URL.HANDLES}` : `${UserAPI.URL.USERS}/${UserAPI.URL.HANDLES}`,
};

const response = await this.client.sendJSON<string[]>(config);
Expand All @@ -505,7 +505,10 @@ export class UserAPI {
public async headHandle(handle: string): Promise<void> {
const config: AxiosRequestConfig = {
method: 'head',
url: `${UserAPI.URL.USERS}/${UserAPI.URL.HANDLES}/${handle}`,
url:
this.backendFeatures.version >= 7
? `${UserAPI.URL.HANDLES}/${handle}`
: `${UserAPI.URL.USERS}/${UserAPI.URL.HANDLES}/${handle}`,
};

await this.client.sendJSON(config);
Expand Down

0 comments on commit aa441ef

Please sign in to comment.