diff options
Diffstat (limited to 'client/src/app/videos/shared')
-rw-r--r-- | client/src/app/videos/shared/video.service.ts | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/client/src/app/videos/shared/video.service.ts b/client/src/app/videos/shared/video.service.ts index b6d2a0666..cfce4cb16 100644 --- a/client/src/app/videos/shared/video.service.ts +++ b/client/src/app/videos/shared/video.service.ts | |||
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core' | |||
2 | import { Observable } from 'rxjs/Observable' | 2 | import { Observable } from 'rxjs/Observable' |
3 | import 'rxjs/add/operator/catch' | 3 | import 'rxjs/add/operator/catch' |
4 | import 'rxjs/add/operator/map' | 4 | import 'rxjs/add/operator/map' |
5 | import { HttpClient, HttpParams } from '@angular/common/http' | 5 | import { HttpClient, HttpParams, HttpRequest } from '@angular/common/http' |
6 | 6 | ||
7 | import { Search } from '../../shared' | 7 | import { Search } from '../../shared' |
8 | import { SortField } from './sort-field.type' | 8 | import { SortField } from './sort-field.type' |
@@ -14,13 +14,14 @@ import { | |||
14 | import { Video } from './video.model' | 14 | import { Video } from './video.model' |
15 | import { VideoPagination } from './video-pagination.model' | 15 | import { VideoPagination } from './video-pagination.model' |
16 | import { | 16 | import { |
17 | UserVideoRate, | 17 | VideoCreate, |
18 | VideoRateType, | 18 | UserVideoRate, |
19 | VideoUpdate, | 19 | VideoRateType, |
20 | VideoAbuseCreate, | 20 | VideoUpdate, |
21 | UserVideoRateUpdate, | 21 | VideoAbuseCreate, |
22 | Video as VideoServerModel, | 22 | UserVideoRateUpdate, |
23 | ResultList | 23 | Video as VideoServerModel, |
24 | ResultList | ||
24 | } from '../../../../../shared' | 25 | } from '../../../../../shared' |
25 | 26 | ||
26 | @Injectable() | 27 | @Injectable() |
@@ -73,6 +74,14 @@ export class VideoService { | |||
73 | .catch(this.restExtractor.handleError) | 74 | .catch(this.restExtractor.handleError) |
74 | } | 75 | } |
75 | 76 | ||
77 | // uploadVideo (video: VideoCreate) { | ||
78 | uploadVideo (video: any) { | ||
79 | const req = new HttpRequest('POST', `${VideoService.BASE_VIDEO_URL}/upload`, video, { reportProgress: true }) | ||
80 | |||
81 | return this.authHttp.request(req) | ||
82 | .catch(this.restExtractor.handleError) | ||
83 | } | ||
84 | |||
76 | getVideos (videoPagination: VideoPagination, sort: SortField) { | 85 | getVideos (videoPagination: VideoPagination, sort: SortField) { |
77 | const pagination = this.videoPaginationToRestPagination(videoPagination) | 86 | const pagination = this.videoPaginationToRestPagination(videoPagination) |
78 | 87 | ||