]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/shared/video.service.ts
Server: avoid request entity too large for requests between pods
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / shared / video.service.ts
index 76d46cbb4aacb87eb20e5251f2a651eb3cfc6b59..b4396f76794abe1eebc2265e66959f3f6ce9f08d 100644 (file)
@@ -1,11 +1,11 @@
 import { Injectable } from '@angular/core';
 import { Http, Response, URLSearchParams } from '@angular/http';
-import { Observable } from 'rxjs/Rx';
+import { Observable } from 'rxjs/Observable';
 
 import { Pagination } from './pagination.model';
 import { Search } from '../../shared';
 import { SortField } from './sort-field.type';
-import { AuthService } from '../../shared';
+import { AuthHttp, AuthService } from '../../shared';
 import { Video } from './video.model';
 
 @Injectable()
@@ -14,6 +14,7 @@ export class VideoService {
 
   constructor(
     private authService: AuthService,
+    private authHttp: AuthHttp,
     private http: Http
   ) {}
 
@@ -35,10 +36,9 @@ export class VideoService {
   }
 
   removeVideo(id: string) {
-    const options = this.authService.getAuthRequestOptions();
-    return this.http.delete(VideoService.BASE_VIDEO_URL + id, options)
-                    .map(res => <number> res.status)
-                    .catch(this.handleError);
+    return this.authHttp.delete(VideoService.BASE_VIDEO_URL + id)
+                        .map(res => <number> res.status)
+                        .catch(this.handleError);
   }
 
   searchVideos(search: Search, pagination: Pagination, sort: SortField) {