mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 20:26:13 +01:00
replace Observable.throw to observableThrowError to avoid undefined error
Signed-off-by: Meina Zhou <meinaz@vmware.com>
This commit is contained in:
parent
081921cf89
commit
1487b649ff
@ -1,7 +1,7 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Http } from '@angular/http';
|
||||
import { Observable } from 'rxjs';
|
||||
import { throwError as observableThrowError, Observable } from 'rxjs';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
|
||||
|
||||
@ -15,34 +15,34 @@ export class GcApiRepository {
|
||||
|
||||
public postSchedule(param): Observable<any> {
|
||||
return this.http.post("/api/system/gc/schedule", param)
|
||||
.pipe(catchError(err => Observable.throw(err)));
|
||||
.pipe(catchError(error => observableThrowError(error)));
|
||||
}
|
||||
|
||||
public putSchedule(param): Observable<any> {
|
||||
return this.http.put("/api/system/gc/schedule", param)
|
||||
.pipe(catchError(err => Observable.throw(err)));
|
||||
.pipe(catchError(error => observableThrowError(error)));
|
||||
}
|
||||
|
||||
public getSchedule(): Observable<any> {
|
||||
return this.http.get("/api/system/gc/schedule")
|
||||
.pipe(catchError(err => Observable.throw(err)))
|
||||
.pipe(catchError(error => observableThrowError(error)))
|
||||
.pipe(map(response => response.json()));
|
||||
}
|
||||
|
||||
public getLog(id): Observable<any> {
|
||||
return this.http.get("/api/system/gc/" + id + "/log")
|
||||
.pipe(catchError(err => Observable.throw(err)));
|
||||
.pipe(catchError(error => observableThrowError(error)));
|
||||
}
|
||||
|
||||
public getStatus(id): Observable<any> {
|
||||
return this.http.get("/api/system/gc/" + id)
|
||||
.pipe(catchError(err => Observable.throw(err)))
|
||||
.pipe(catchError(error => observableThrowError(error)))
|
||||
.pipe(map(response => response.json()));
|
||||
}
|
||||
|
||||
public getJobs(): Observable<any> {
|
||||
return this.http.get("/api/system/gc")
|
||||
.pipe(catchError(err => Observable.throw(err)))
|
||||
.pipe(catchError(error => observableThrowError(error)))
|
||||
.pipe(map(response => response.json()));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user