import { Injectable } from '@angular/core' ; import { ApiCallService } from '../../services/api-call.service' ; import { map } from 'rxjs/operators' ; @ Injectable ( { providedIn : 'root' } ) export class ExternalSystemService { private servicePrefix : string = 'externalsystem' ; constructor ( private api ) { } public getExternSystemList ( ) { return this . api . callGet < any [ ] > ( this . servicePrefix + '/' ) . pipe ( map ( ( apiResponse ) => { if ( apiResponse . status === 204 ) { return [ ] ; } return apiResponse . body ; } ) ) ; } public getExternSystemParams ( name ) { return this . api . callGet < any > ( this . servicePrefix + '/parameters/' + name ) . pipe ( map ( ( apiResponse ) => { if ( apiResponse . status === 204 ) { return [ ] ; } return apiResponse . body ; } ) ) ; } public getExternSystemVariables ( name ) { return this . api . callGet < any > ( this . servicePrefix + '/variables/' + name ) . pipe ( map ( ( apiResponse ) => { if ( apiResponse . status === 204 ) { return [ ] ; } return apiResponse . body ; } ) ) ; } }