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()
constructor(
private authService: AuthService,
+ private authHttp: AuthHttp,
private http: Http
) {}
}
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) {