aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video-abuse
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-05-15 11:55:51 +0200
committerChocobozzz <me@florianbigard.com>2018-05-16 09:42:54 +0200
commitdb400f447a9f7aae1c56fa25396e93069744483f (patch)
treef45af832a5d3f4eebafd2f885b7413d9f84fa374 /client/src/app/shared/video-abuse
parent54c3a22faa04bf13eea37f39be9149fc5eb95737 (diff)
downloadPeerTube-db400f447a9f7aae1c56fa25396e93069744483f.tar.gz
PeerTube-db400f447a9f7aae1c56fa25396e93069744483f.tar.zst
PeerTube-db400f447a9f7aae1c56fa25396e93069744483f.zip
Upgrade to rxjs 6
Diffstat (limited to 'client/src/app/shared/video-abuse')
-rw-r--r--client/src/app/shared/video-abuse/video-abuse.service.ts17
1 files changed, 10 insertions, 7 deletions
diff --git a/client/src/app/shared/video-abuse/video-abuse.service.ts b/client/src/app/shared/video-abuse/video-abuse.service.ts
index ae00c4c45..6fab3ef43 100644
--- a/client/src/app/shared/video-abuse/video-abuse.service.ts
+++ b/client/src/app/shared/video-abuse/video-abuse.service.ts
@@ -1,9 +1,8 @@
1import { catchError, map } from 'rxjs/operators'
1import { HttpClient, HttpParams } from '@angular/common/http' 2import { HttpClient, HttpParams } from '@angular/common/http'
2import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
3import { SortMeta } from 'primeng/components/common/sortmeta' 4import { SortMeta } from 'primeng/components/common/sortmeta'
4import 'rxjs/add/operator/catch' 5import { Observable } from 'rxjs'
5import 'rxjs/add/operator/map'
6import { Observable } from 'rxjs/Observable'
7import { ResultList, VideoAbuse } from '../../../../../shared' 6import { ResultList, VideoAbuse } from '../../../../../shared'
8import { environment } from '../../../environments/environment' 7import { environment } from '../../../environments/environment'
9import { RestExtractor, RestPagination, RestService } from '../rest' 8import { RestExtractor, RestPagination, RestService } from '../rest'
@@ -25,8 +24,10 @@ export class VideoAbuseService {
25 params = this.restService.addRestGetParams(params, pagination, sort) 24 params = this.restService.addRestGetParams(params, pagination, sort)
26 25
27 return this.authHttp.get<ResultList<VideoAbuse>>(url, { params }) 26 return this.authHttp.get<ResultList<VideoAbuse>>(url, { params })
28 .map(res => this.restExtractor.convertResultListDateToHuman(res)) 27 .pipe(
29 .catch(res => this.restExtractor.handleError(res)) 28 map(res => this.restExtractor.convertResultListDateToHuman(res)),
29 catchError(res => this.restExtractor.handleError(res))
30 )
30 } 31 }
31 32
32 reportVideo (id: number, reason: string) { 33 reportVideo (id: number, reason: string) {
@@ -36,7 +37,9 @@ export class VideoAbuseService {
36 } 37 }
37 38
38 return this.authHttp.post(url, body) 39 return this.authHttp.post(url, body)
39 .map(this.restExtractor.extractDataBool) 40 .pipe(
40 .catch(res => this.restExtractor.handleError(res)) 41 map(this.restExtractor.extractDataBool),
42 catchError(res => this.restExtractor.handleError(res))
43 )
41 } 44 }
42} 45}