Fixed service

This commit is contained in:
Luca Frosini 2019-10-17 15:49:39 +02:00
parent 7c174c5c3a
commit 55f5bbc00a
1 changed files with 1 additions and 13 deletions

View File

@ -4,12 +4,9 @@ import { Observable, of } from 'rxjs';
import { catchError } from 'rxjs/operators';
import { TypeDefinition } from './is-model/types/TypeDefinition';
import { types } from './types';
import { list } from './list';
import { Facet } from './is-model/reference/entities/Facet';
import { Resource } from './is-model/reference/entities/Resource';
import { resources } from './resources';
@Injectable({
providedIn: 'root'
})
@ -51,17 +48,8 @@ export class IsService {
).subscribe(data => callback(data));
}
public getIdentifyingFacets(resourceType: string, callback: (instances: Facet[]) => void): void {
const url = this.queryURL + resourceType + '?polymorphic=true&gcube-token=' + this.token;
// const observable: Observable<ISType[]> = of(types);
const observable: Observable<any[]> = this.httpClient.get<any[]>(url);
observable.pipe(
catchError(this.handleError<any[]>('getIdentifyingFacets()', list))
).subscribe(data => callback(data));
}
public getResourceInstances(resourceType: string, callback: (instances: Resource[]) => void): void {
const url = this.queryURL + resourceType + '?polymorphic=true&gcube-token=' + this.token;
const url = this.queryURL + resourceType + '?polymorphic=true&gcube-token=' + this.token;
// const observable: Observable<ISType[]> = of(types);
const observable: Observable<any[]> = this.httpClient.get<any[]>(url);
observable.pipe(