Merge branch 'develop' of https://git.akkerweb.nl/FarmMaps/FarmMapsLib into develop
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:
commit
146514d386
@ -14,19 +14,9 @@ export class SchemaService {
|
|||||||
return this.appConfig.getConfig('apiEndPoint');
|
return this.appConfig.getConfig('apiEndPoint');
|
||||||
}
|
}
|
||||||
|
|
||||||
public getSchemaIdFromSchemaUrl(schemaUrl): string {
|
/** Takes decoded schema url id */
|
||||||
const url = new URL(schemaUrl);
|
public getSchema(id): Observable<string> {
|
||||||
const pathSplit = url.pathname.split('/');
|
const encodedId = encodeURIComponent(id);
|
||||||
|
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/schema/${encodedId}`);
|
||||||
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}`);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user