import axios , { AxiosPromise , AxiosRequestConfig } from "axios" ; import { lazyInject } from "../../inversify.config" ; import ComponentStatusStore from "../../stores/ComponentStatusStore" ; export abstract class BackendService { @ lazyInject ( "ComponentStatusStore" ) protected readonly componentStatusStore ! : ComponentStatusStore ; public callApi ( route , options = { } ) { return axios . get ( this . getApiUrl ( ) + route , options ) ; } private getApiUrl ( ) { return ( this . componentStatusStore . appConfiguration . baseUrl || "" ) + "/api" ; } }