diff options
Diffstat (limited to 'client/src/app/shared/video/video.service.ts')
-rw-r--r-- | client/src/app/shared/video/video.service.ts | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/video/video.service.ts index b2a26417c..3f35b67c4 100644 --- a/client/src/app/shared/video/video.service.ts +++ b/client/src/app/shared/video/video.service.ts | |||
@@ -11,7 +11,7 @@ import { VideoRateType } from '../../../../../shared/models/videos/video-rate.ty | |||
11 | import { VideoUpdate } from '../../../../../shared/models/videos/video-update.model' | 11 | import { VideoUpdate } from '../../../../../shared/models/videos/video-update.model' |
12 | import { RestExtractor } from '../rest/rest-extractor.service' | 12 | import { RestExtractor } from '../rest/rest-extractor.service' |
13 | import { RestService } from '../rest/rest.service' | 13 | import { RestService } from '../rest/rest.service' |
14 | import { Search } from '../search/search.model' | 14 | import { Search } from '../header/search.model' |
15 | import { UserService } from '../users/user.service' | 15 | import { UserService } from '../users/user.service' |
16 | import { SortField } from './sort-field.type' | 16 | import { SortField } from './sort-field.type' |
17 | import { VideoDetails } from './video-details.model' | 17 | import { VideoDetails } from './video-details.model' |
@@ -91,15 +91,14 @@ export class VideoService { | |||
91 | .catch((res) => this.restExtractor.handleError(res)) | 91 | .catch((res) => this.restExtractor.handleError(res)) |
92 | } | 92 | } |
93 | 93 | ||
94 | searchVideos (search: Search, videoPagination: VideoPagination, sort: SortField): Observable<{ videos: Video[], totalVideos: number}> { | 94 | searchVideos (search: string, videoPagination: VideoPagination, sort: SortField): Observable<{ videos: Video[], totalVideos: number}> { |
95 | const url = VideoService.BASE_VIDEO_URL + 'search/' + encodeURIComponent(search.value) | 95 | const url = VideoService.BASE_VIDEO_URL + 'search' |
96 | 96 | ||
97 | const pagination = this.videoPaginationToRestPagination(videoPagination) | 97 | const pagination = this.videoPaginationToRestPagination(videoPagination) |
98 | 98 | ||
99 | let params = new HttpParams() | 99 | let params = new HttpParams() |
100 | params = this.restService.addRestGetParams(params, pagination, sort) | 100 | params = this.restService.addRestGetParams(params, pagination, sort) |
101 | 101 | params = params.append('search', search) | |
102 | if (search.field) params.set('field', search.field) | ||
103 | 102 | ||
104 | return this.authHttp | 103 | return this.authHttp |
105 | .get<ResultList<VideoServerModel>>(url, { params }) | 104 | .get<ResultList<VideoServerModel>>(url, { params }) |