argos/dmp-frontend/src/app/services/external-sources/external-sources-configurat...

29 lines
1022 B
TypeScript
Raw Normal View History

2018-10-05 17:00:54 +02:00
import { HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
2018-11-27 15:13:56 +01:00
import { environment } from '../../../environments/environment';
import { ExternalSourcesConfiguration } from '../../models/external-sources/ExternalSourcesConfiguration';
import { BaseHttpService } from '../../utilities/cite-http-service-module/base-http.service';
2018-05-28 11:50:42 +02:00
@Injectable()
export class ExternalSourcesConfigurationService {
2018-10-05 17:00:54 +02:00
private actionUrl: string;
private headers: HttpHeaders;
2018-05-28 11:50:42 +02:00
2018-10-05 17:00:54 +02:00
constructor(private http: BaseHttpService) {
2018-05-28 11:50:42 +02:00
2018-11-27 15:13:56 +01:00
this.actionUrl = environment.Server + 'common/';
2018-05-28 11:50:42 +02:00
2018-10-05 17:00:54 +02:00
this.headers = new HttpHeaders();
this.headers = this.headers.set('Content-Type', 'application/json');
this.headers = this.headers.set('Accept', 'application/json');
}
2018-05-28 11:50:42 +02:00
2018-10-05 17:00:54 +02:00
public getExternalSourcesConfiguration(): Observable<ExternalSourcesConfiguration> {
return this.http.get<ExternalSourcesConfiguration>(this.actionUrl + 'externalSourcesConfiguration', { headers: this.headers });
}
2018-05-28 11:50:42 +02:00
}