From 7b7cc5c0a301a6bca747ee17299b0ec95bc8b04a Mon Sep 17 00:00:00 2001 From: FangyuanCheng Date: Thu, 21 Mar 2019 16:14:09 +0800 Subject: [PATCH] fix bug Signed-off-by: FangyuanCheng --- src/portal/lib/src/service/endpoint.service.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/portal/lib/src/service/endpoint.service.ts b/src/portal/lib/src/service/endpoint.service.ts index a63723c32..ee8250a1a 100644 --- a/src/portal/lib/src/service/endpoint.service.ts +++ b/src/portal/lib/src/service/endpoint.service.ts @@ -59,7 +59,7 @@ export abstract class EndpointService { * * @memberOf EndpointService */ - abstract getAdapters(): Observable | Promise | any; + abstract getAdapters(): Observable; /** * Create new endpoint. @@ -178,12 +178,11 @@ export class EndpointDefaultService extends EndpointService { , catchError(error => observableThrowError(error))); } - public getAdapters(): Observable | Promise | any { + public getAdapters(): Observable { return this.http .get(`/api/replication/adapters`) - .toPromise() - .then(response => response.json() as Adapter) - .catch(error => Promise.reject(error)); + .pipe(map(response => response.json() as Adapter) + , catchError(error => observableThrowError(error))); } public createEndpoint(