File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 11import axios from 'axios' ;
22
33class 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 ;
You can’t perform that action at this time.
0 commit comments