File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change 1- class Api {
2- token = '' ;
1+ export default {
2+ token : '' ,
33
44 async decodeResults ( result ) {
55 const decoded = await result . json ( ) ;
@@ -10,7 +10,7 @@ class Api {
1010 throw Error ( `Unexpected status ${ result . status } ` ) ;
1111 }
1212 return decoded ;
13- }
13+ } ,
1414
1515 // apiGet performs a GET request on the API with given local URL.
1616 // The result is decoded from JSON and returned.
@@ -23,7 +23,7 @@ class Api {
2323 }
2424 const result = await fetch ( localURL , { headers} ) ;
2525 return this . decodeResults ( result ) ;
26- }
26+ } ,
2727
2828 // apiPost performs a POST request on the API with given local URL and given data.
2929 // The result is decoded from JSON and returned.
@@ -42,8 +42,4 @@ class Api {
4242 } ) ;
4343 return this . decodeResults ( result ) ;
4444 }
45- }
46-
47- var api = new Api ( ) ;
48-
49- export default api ;
45+ } ;
You can’t perform that action at this time.
0 commit comments