X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Badmin%2Fsystem%2Fjobs%2Fjob.service.ts;h=4b4a8914fdd5543776351be93853e790ffc5624a;hb=83e74670419d8faf005d36ef2e8b8ac3166012d7;hp=1ac50f050f9f3f39ef5cca0ed965f1d74a7e4f58;hpb=67ed6552b831df66713bac9e672738796128d33f;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+admin/system/jobs/job.service.ts b/client/src/app/+admin/system/jobs/job.service.ts index 1ac50f050..4b4a8914f 100644 --- a/client/src/app/+admin/system/jobs/job.service.ts +++ b/client/src/app/+admin/system/jobs/job.service.ts @@ -19,13 +19,20 @@ export class JobService { private restExtractor: RestExtractor ) {} - getJobs (jobState: JobStateClient, jobType: JobTypeClient, pagination: RestPagination, sort: SortMeta): Observable> { + getJobs (options: { + jobState?: JobStateClient, + jobType: JobTypeClient, + pagination: RestPagination, + sort: SortMeta + }): Observable> { + const { jobState, jobType, pagination, sort } = options + let params = new HttpParams() params = this.restService.addRestGetParams(params, pagination, sort) if (jobType !== 'all') params = params.append('jobType', jobType) - return this.authHttp.get>(JobService.BASE_JOB_URL + '/' + jobState, { params }) + return this.authHttp.get>(JobService.BASE_JOB_URL + `/${jobState ? jobState : ''}`, { params }) .pipe( map(res => { return this.restExtractor.convertResultListDateToHuman(res, [ 'createdAt', 'processedOn', 'finishedOn' ])