Mark van der Wal
4527276254
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
23 lines
623 B
TypeScript
23 lines
623 B
TypeScript
import {Injectable} from '@angular/core';
|
|
import {HttpClient} from '@angular/common/http';
|
|
import {AppConfig} from '../shared/app.config';
|
|
import {Observable} from 'rxjs';
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class SchemaService {
|
|
constructor(private httpClient: HttpClient, private appConfig: AppConfig) {
|
|
}
|
|
|
|
ApiEndpoint() {
|
|
return this.appConfig.getConfig('apiEndPoint');
|
|
}
|
|
|
|
/** Takes decoded schema url id */
|
|
public getSchema(id): Observable<string> {
|
|
const encodedId = encodeURIComponent(id);
|
|
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/schema/${encodedId}`);
|
|
}
|
|
}
|