Fixed imports due to refactoring

This commit is contained in:
Luca Frosini 2019-10-16 11:50:26 +02:00
parent f18fe6b9de
commit 21a2ff9195
1 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable, of } from 'rxjs';
import { catchError } from 'rxjs/operators';
import { ISType } from './ISType';
import { TypeDefinition } from './is-model/types/TypeDefinition';
import { types } from './types';
import { list } from './list';
@ -39,12 +39,12 @@ export class IsService {
};
}
public getResourceTypes(callback: (isTypes: ISType[]) => void): void {
public getResourceTypes(callback: (isTypes: TypeDefinition[]) => void): void {
const url = this.typesURL + '/Resource?polymorphic=true&gcube-token=' + this.token;
// const observable: Observable<ISType[]> = of(types);
const observable: Observable<ISType[]> = this.httpClient.get<ISType[]>(url);
const observable: Observable<TypeDefinition[]> = this.httpClient.get<TypeDefinition[]>(url);
observable.pipe(
catchError(this.handleError<ISType[]>('getResourceTypes()', types))
catchError(this.handleError<TypeDefinition[]>('getResourceTypes()', types))
).subscribe(data => callback(data));
}