Changed schema service.
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
parent
6f52302875
commit
4527276254
@ -14,19 +14,9 @@ export class SchemaService {
|
||||
return this.appConfig.getConfig('apiEndPoint');
|
||||
}
|
||||
|
||||
public getSchemaIdFromSchemaUrl(schemaUrl): string {
|
||||
const url = new URL(schemaUrl);
|
||||
const pathSplit = url.pathname.split('/');
|
||||
|
||||
return pathSplit[pathSplit.length - 1].replace('.json', '');
|
||||
}
|
||||
|
||||
public getSchemaWithUrl(schemaUrl): Observable<string> {
|
||||
const id = this.getSchemaIdFromSchemaUrl(schemaUrl);
|
||||
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/schema/${id}`);
|
||||
}
|
||||
|
||||
public getSchemaWithId(schemaId): Observable<string> {
|
||||
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/schema/${schemaId}`);
|
||||
/** 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}`);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user