mirror of
https://github.com/goharbor/harbor.git
synced 2024-09-26 20:42:43 +02:00
Merge pull request #6001 from zhoumeina/fix_console_error_gc
replace Observable.throw to observableThrowError to avoid undefined e…
This commit is contained in:
commit
7116baabed
@ -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