Merge pull request #7195 from pureshine/replication-page

Fix bugs that adapters can't display
This commit is contained in:
Wenkai Yin 2019-03-22 09:56:21 +08:00 committed by GitHub
commit 9b9f2a7e94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,7 +59,7 @@ export abstract class EndpointService {
*
* @memberOf EndpointService
*/
abstract getAdapters(): Observable<any> | Promise<any> | any;
abstract getAdapters(): Observable<any>;
/**
* Create new endpoint.
@ -178,12 +178,11 @@ export class EndpointDefaultService extends EndpointService {
, catchError(error => observableThrowError(error)));
}
public getAdapters(): Observable<any> | Promise<any> | any {
public getAdapters(): Observable<any> {
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(