]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-main/video/video-ownership.service.ts
Fix support field when updating the video
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-main / video / video-ownership.service.ts
index 273930a6cf0b16fcc1d7483e0fdc2b5a727d7f30..1e8f7f68cc9f40248aee55d9d541075754700d74 100644 (file)
@@ -1,6 +1,6 @@
 import { SortMeta } from 'primeng/api'
 import { Observable } from 'rxjs'
-import { catchError, map } from 'rxjs/operators'
+import { catchError } from 'rxjs/operators'
 import { HttpClient, HttpParams } from '@angular/common/http'
 import { Injectable } from '@angular/core'
 import { RestExtractor, RestPagination, RestService } from '@app/core'
@@ -25,10 +25,7 @@ export class VideoOwnershipService {
     }
 
     return this.authHttp.post(url, body)
-      .pipe(
-        map(this.restExtractor.extractDataBool),
-        catchError(res => this.restExtractor.handleError(res))
-      )
+      .pipe(catchError(res => this.restExtractor.handleError(res)))
   }
 
   getOwnershipChanges (pagination: RestPagination, sort: SortMeta): Observable<ResultList<VideoChangeOwnership>> {
@@ -38,27 +35,18 @@ export class VideoOwnershipService {
     params = this.restService.addRestGetParams(params, pagination, sort)
 
     return this.authHttp.get<ResultList<VideoChangeOwnership>>(url, { params })
-      .pipe(
-        map(res => this.restExtractor.convertResultListDateToHuman(res)),
-        catchError(res => this.restExtractor.handleError(res))
-      )
+      .pipe(catchError(res => this.restExtractor.handleError(res)))
   }
 
   acceptOwnership (id: number, input: VideoChangeOwnershipAccept) {
     const url = VideoOwnershipService.BASE_VIDEO_CHANGE_OWNERSHIP_URL + 'ownership/' + id + '/accept'
     return this.authHttp.post(url, input)
-      .pipe(
-        map(this.restExtractor.extractDataBool),
-        catchError(this.restExtractor.handleError)
-      )
+      .pipe(catchError(this.restExtractor.handleError))
   }
 
   refuseOwnership (id: number) {
     const url = VideoOwnershipService.BASE_VIDEO_CHANGE_OWNERSHIP_URL + 'ownership/' + id + '/refuse'
     return this.authHttp.post(url, {})
-      .pipe(
-        map(this.restExtractor.extractDataBool),
-        catchError(this.restExtractor.handleError)
-      )
+      .pipe(catchError(this.restExtractor.handleError))
   }
 }