diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-15 11:55:51 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-16 09:42:54 +0200 |
commit | db400f447a9f7aae1c56fa25396e93069744483f (patch) | |
tree | f45af832a5d3f4eebafd2f885b7413d9f84fa374 /client/src/app/+admin/jobs/shared | |
parent | 54c3a22faa04bf13eea37f39be9149fc5eb95737 (diff) | |
download | PeerTube-db400f447a9f7aae1c56fa25396e93069744483f.tar.gz PeerTube-db400f447a9f7aae1c56fa25396e93069744483f.tar.zst PeerTube-db400f447a9f7aae1c56fa25396e93069744483f.zip |
Upgrade to rxjs 6
Diffstat (limited to 'client/src/app/+admin/jobs/shared')
-rw-r--r-- | client/src/app/+admin/jobs/shared/job.service.ts | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/client/src/app/+admin/jobs/shared/job.service.ts b/client/src/app/+admin/jobs/shared/job.service.ts index 98f29b742..6441eaac1 100644 --- a/client/src/app/+admin/jobs/shared/job.service.ts +++ b/client/src/app/+admin/jobs/shared/job.service.ts | |||
@@ -1,9 +1,8 @@ | |||
1 | import { catchError, map } from 'rxjs/operators' | ||
1 | import { HttpClient, HttpParams } from '@angular/common/http' | 2 | import { HttpClient, HttpParams } from '@angular/common/http' |
2 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
3 | import { SortMeta } from 'primeng/primeng' | 4 | import { SortMeta } from 'primeng/primeng' |
4 | import 'rxjs/add/operator/catch' | 5 | import { Observable } from 'rxjs' |
5 | import 'rxjs/add/operator/map' | ||
6 | import { Observable } from 'rxjs/Observable' | ||
7 | import { ResultList } from '../../../../../../shared' | 6 | import { ResultList } from '../../../../../../shared' |
8 | import { JobState } from '../../../../../../shared/models' | 7 | import { JobState } from '../../../../../../shared/models' |
9 | import { Job } from '../../../../../../shared/models/server/job.model' | 8 | import { Job } from '../../../../../../shared/models/server/job.model' |
@@ -25,9 +24,11 @@ export class JobService { | |||
25 | params = this.restService.addRestGetParams(params, pagination, sort) | 24 | params = this.restService.addRestGetParams(params, pagination, sort) |
26 | 25 | ||
27 | return this.authHttp.get<ResultList<Job>>(JobService.BASE_JOB_URL + '/' + state, { params }) | 26 | return this.authHttp.get<ResultList<Job>>(JobService.BASE_JOB_URL + '/' + state, { params }) |
28 | .map(res => this.restExtractor.convertResultListDateToHuman(res, [ 'createdAt', 'updatedAt' ])) | 27 | .pipe( |
29 | .map(res => this.restExtractor.applyToResultListData(res, this.prettyPrintData)) | 28 | map(res => this.restExtractor.convertResultListDateToHuman(res, [ 'createdAt', 'updatedAt' ])), |
30 | .catch(err => this.restExtractor.handleError(err)) | 29 | map(res => this.restExtractor.applyToResultListData(res, this.prettyPrintData)), |
30 | catchError(err => this.restExtractor.handleError(err)) | ||
31 | ) | ||
31 | } | 32 | } |
32 | 33 | ||
33 | private prettyPrintData (obj: Job) { | 34 | private prettyPrintData (obj: Job) { |