Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"useTabs": true,
"useTabs": false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using tabs, this is the only repo that doesn't

"tabWidth": 4,
"semi": true,
"singleQuote": false,
"trailingComma": "all",
Expand Down
16 changes: 10 additions & 6 deletions src/lib/services/apiClient.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function createApiClient({ baseUrl, apiKey }: ApiClientOptions): ApiClien

const authHeaders: any = {
"X-Api-Key": apiKey,
}
};

const httpClient = axios.create({
baseURL: baseUrl,
Expand Down Expand Up @@ -58,7 +58,7 @@ export function createApiClient({ baseUrl, apiKey }: ApiClientOptions): ApiClien

async function updateUser(userId: string, update: UserUpdate) {
try {
const request = () => httpClient.put<User>(`/users/${userId}`, update);
const request = () => httpClient.patch<User>(`/users/${userId}`, update);
const { data } = await authInterceptor<{ data: User }>(request);

return data;
Expand Down Expand Up @@ -105,9 +105,13 @@ export function createApiClient({ baseUrl, apiKey }: ApiClientOptions): ApiClien

async function refreshToken(walletAddress: string) {
try {
const { data } = await httpClient.post<AuthResponse>(`/login/refresh`, { walletAddress }, {
headers: authHeaders,
});
const { data } = await httpClient.post<AuthResponse>(
`/login/refresh`,
{ walletAddress },
{
headers: authHeaders,
},
);
console.debug(" - Token was refreshed");

return data;
Expand Down Expand Up @@ -208,7 +212,7 @@ export function createApiClient({ baseUrl, apiKey }: ApiClientOptions): ApiClien
getUserStatus,
getQuote,
transact,
setWalletAddress
setWalletAddress,
};
}

Expand Down