Skip to content

Commit 89e148c

Browse files
committed
fix: dashboard client
1 parent 1b7cfab commit 89e148c

3 files changed

Lines changed: 2 additions & 74 deletions

File tree

packages/apps/staking/src/services/dashboard.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import api from '../utils/api';
33

44
export const getKVStoreData = async (
55
address: string,
6-
chainId: number
6+
chainId: number,
77
): Promise<IKVStore[]> => {
88
const response = await api.get(`details/kvstore/${address}`, {
9-
params: { chain_id: chainId },
9+
params: { chainId },
1010
});
1111

1212
// Validate if response is IKVStore[]
Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,7 @@
11
import axios from 'axios';
2-
import { CaseConverter } from './case-converter';
32

43
const axiosInstance = axios.create({
54
baseURL: import.meta.env.VITE_APP_DASHBOARD_API_URL,
65
});
76

8-
axiosInstance.interceptors.request.use(
9-
(config) => {
10-
if (config.data) {
11-
config.data = CaseConverter.transformToSnakeCase(config.data);
12-
}
13-
14-
if (config.params) {
15-
config.params = CaseConverter.transformToSnakeCase(config.params);
16-
}
17-
18-
return config;
19-
},
20-
(error) => Promise.reject(error)
21-
);
22-
23-
axiosInstance.interceptors.response.use(
24-
(response) => {
25-
if (response.data) {
26-
response.data = CaseConverter.transformToCamelCase(response.data);
27-
}
28-
return response;
29-
},
30-
(error) => {
31-
return Promise.reject(error);
32-
}
33-
);
34-
357
export default axiosInstance;

packages/apps/staking/src/utils/case-converter.ts

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)