diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-22 15:40:13 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-07-24 10:58:16 +0200 |
commit | 93cae47925e4dd68b7d34a41927b2740b4fab1b4 (patch) | |
tree | f649ab49fab1886b434e164591990cc99b234466 /client/src/app/search/search.service.ts | |
parent | 587568e1cc0e33c023c1ac62dd28fef313285250 (diff) | |
download | PeerTube-93cae47925e4dd68b7d34a41927b2740b4fab1b4.tar.gz PeerTube-93cae47925e4dd68b7d34a41927b2740b4fab1b4.tar.zst PeerTube-93cae47925e4dd68b7d34a41927b2740b4fab1b4.zip |
Add client hooks
Diffstat (limited to 'client/src/app/search/search.service.ts')
-rw-r--r-- | client/src/app/search/search.service.ts | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/client/src/app/search/search.service.ts b/client/src/app/search/search.service.ts index cd3bdad35..8f137a321 100644 --- a/client/src/app/search/search.service.ts +++ b/client/src/app/search/search.service.ts | |||
@@ -23,13 +23,14 @@ export class SearchService { | |||
23 | private videoService: VideoService | 23 | private videoService: VideoService |
24 | ) {} | 24 | ) {} |
25 | 25 | ||
26 | searchVideos ( | 26 | searchVideos (parameters: { |
27 | search: string, | 27 | search: string, |
28 | componentPagination: ComponentPagination, | 28 | componentPagination: ComponentPagination, |
29 | advancedSearch: AdvancedSearch | 29 | advancedSearch: AdvancedSearch |
30 | ): Observable<{ videos: Video[], totalVideos: number }> { | 30 | }): Observable<ResultList<Video>> { |
31 | const url = SearchService.BASE_SEARCH_URL + 'videos' | 31 | const { search, componentPagination, advancedSearch } = parameters |
32 | 32 | ||
33 | const url = SearchService.BASE_SEARCH_URL + 'videos' | ||
33 | const pagination = this.restService.componentPaginationToRestPagination(componentPagination) | 34 | const pagination = this.restService.componentPaginationToRestPagination(componentPagination) |
34 | 35 | ||
35 | let params = new HttpParams() | 36 | let params = new HttpParams() |
@@ -48,12 +49,13 @@ export class SearchService { | |||
48 | ) | 49 | ) |
49 | } | 50 | } |
50 | 51 | ||
51 | searchVideoChannels ( | 52 | searchVideoChannels (parameters: { |
52 | search: string, | 53 | search: string, |
53 | componentPagination: ComponentPagination | 54 | componentPagination: ComponentPagination |
54 | ): Observable<{ data: VideoChannel[], total: number }> { | 55 | }): Observable<ResultList<VideoChannel>> { |
55 | const url = SearchService.BASE_SEARCH_URL + 'video-channels' | 56 | const { search, componentPagination } = parameters |
56 | 57 | ||
58 | const url = SearchService.BASE_SEARCH_URL + 'video-channels' | ||
57 | const pagination = this.restService.componentPaginationToRestPagination(componentPagination) | 59 | const pagination = this.restService.componentPaginationToRestPagination(componentPagination) |
58 | 60 | ||
59 | let params = new HttpParams() | 61 | let params = new HttpParams() |