X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fvideos%2Fshared%2Fvideo.service.ts;h=b4396f76794abe1eebc2265e66959f3f6ce9f08d;hb=def16d33d19153c6583fa8a30634760b3d64d34c;hp=76d46cbb4aacb87eb20e5251f2a651eb3cfc6b59;hpb=4a6995be18b15de1834a39c8921a0e4109671bb6;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/videos/shared/video.service.ts b/client/src/app/videos/shared/video.service.ts index 76d46cbb4..b4396f767 100644 --- a/client/src/app/videos/shared/video.service.ts +++ b/client/src/app/videos/shared/video.service.ts @@ -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 => res.status) - .catch(this.handleError); + return this.authHttp.delete(VideoService.BASE_VIDEO_URL + id) + .map(res => res.status) + .catch(this.handleError); } searchVideos(search: Search, pagination: Pagination, sort: SortField) {