diff options
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/video/video.service.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/video/video.service.ts index a151a2983..0a8894fd9 100644 --- a/client/src/app/shared/video/video.service.ts +++ b/client/src/app/shared/video/video.service.ts | |||
@@ -7,6 +7,7 @@ import { Video as VideoServerModel, VideoDetails as VideoDetailsServerModel } fr | |||
7 | import { ResultList } from '../../../../../shared/models/result-list.model' | 7 | import { ResultList } from '../../../../../shared/models/result-list.model' |
8 | import { UserVideoRateUpdate } from '../../../../../shared/models/videos/user-video-rate-update.model' | 8 | import { UserVideoRateUpdate } from '../../../../../shared/models/videos/user-video-rate-update.model' |
9 | import { UserVideoRate } from '../../../../../shared/models/videos/user-video-rate.model' | 9 | import { UserVideoRate } from '../../../../../shared/models/videos/user-video-rate.model' |
10 | import { VideoFilter } from '../../../../../shared/models/videos/video-query.type' | ||
10 | import { VideoRateType } from '../../../../../shared/models/videos/video-rate.type' | 11 | import { VideoRateType } from '../../../../../shared/models/videos/video-rate.type' |
11 | import { VideoUpdate } from '../../../../../shared/models/videos/video-update.model' | 12 | import { VideoUpdate } from '../../../../../shared/models/videos/video-update.model' |
12 | import { environment } from '../../../environments/environment' | 13 | import { environment } from '../../../environments/environment' |
@@ -94,12 +95,20 @@ export class VideoService { | |||
94 | .catch((res) => this.restExtractor.handleError(res)) | 95 | .catch((res) => this.restExtractor.handleError(res)) |
95 | } | 96 | } |
96 | 97 | ||
97 | getVideos (videoPagination: ComponentPagination, sort: SortField): Observable<{ videos: Video[], totalVideos: number}> { | 98 | getVideos ( |
99 | videoPagination: ComponentPagination, | ||
100 | sort: SortField, | ||
101 | filter?: VideoFilter | ||
102 | ): Observable<{ videos: Video[], totalVideos: number}> { | ||
98 | const pagination = this.restService.componentPaginationToRestPagination(videoPagination) | 103 | const pagination = this.restService.componentPaginationToRestPagination(videoPagination) |
99 | 104 | ||
100 | let params = new HttpParams() | 105 | let params = new HttpParams() |
101 | params = this.restService.addRestGetParams(params, pagination, sort) | 106 | params = this.restService.addRestGetParams(params, pagination, sort) |
102 | 107 | ||
108 | if (filter) { | ||
109 | params = params.set('filter', filter) | ||
110 | } | ||
111 | |||
103 | return this.authHttp | 112 | return this.authHttp |
104 | .get(VideoService.BASE_VIDEO_URL, { params }) | 113 | .get(VideoService.BASE_VIDEO_URL, { params }) |
105 | .map(this.extractVideos) | 114 | .map(this.extractVideos) |