Skip to content

Commit a4c3b62

Browse files
committed
MK8S-197 - Fix the type issue of ApiClient
1 parent d8010bd commit a4c3b62

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

ui/src/services/ApiClient.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
import axios from 'axios';
22

33
class ApiClient {
4-
constructor({ apiUrl, headers = {} }) {
5-
// @ts-expect-error - FIXME when you are working on it
4+
headers: Record<string, string>;
5+
settings: { baseURL: string };
6+
7+
constructor({
8+
apiUrl,
9+
headers = {},
10+
}: {
11+
apiUrl: string;
12+
headers?: Record<string, string>;
13+
}) {
614
this.headers = headers;
7-
// @ts-expect-error - FIXME when you are working on it
815
this.settings = {
916
baseURL: apiUrl,
1017
};
1118
}
1219

1320
setHeaders = (headers) => {
14-
// @ts-expect-error - FIXME when you are working on it
1521
this.headers = { ...this.headers, ...headers };
1622
};
1723

@@ -72,12 +78,10 @@ class ApiClient {
7278
try {
7379
const response = await axios({
7480
method,
75-
// @ts-expect-error - FIXME when you are working on it
7681
headers: { ...this.headers, ...headers },
7782
params,
7883
url: endpoint,
7984
data: payload,
80-
// @ts-expect-error - FIXME when you are working on it
8185
...this.settings,
8286
});
8387
return response.data;

0 commit comments

Comments
 (0)