diff options
author | Chocobozzz <me@florianbigard.com> | 2020-03-11 16:41:38 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-03-11 16:45:09 +0100 |
commit | 111fdc267b36201cf1be1fdf91017005102b4a5e (patch) | |
tree | 5ea98f766cc74de3434a855e998e763324e9da72 /client/src/app/shared | |
parent | 764a965778ac89e027fd05dd35697c6763e0dc18 (diff) | |
download | PeerTube-111fdc267b36201cf1be1fdf91017005102b4a5e.tar.gz PeerTube-111fdc267b36201cf1be1fdf91017005102b4a5e.tar.zst PeerTube-111fdc267b36201cf1be1fdf91017005102b4a5e.zip |
Handle overview pagination in client
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/overview/overview.service.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/client/src/app/shared/overview/overview.service.ts b/client/src/app/shared/overview/overview.service.ts index 79cb781f7..6d8af8052 100644 --- a/client/src/app/shared/overview/overview.service.ts +++ b/client/src/app/shared/overview/overview.service.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { catchError, map, switchMap, tap } from 'rxjs/operators' | 1 | import { catchError, map, switchMap, tap } from 'rxjs/operators' |
2 | import { HttpClient } from '@angular/common/http' | 2 | import { HttpClient, HttpParams } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { forkJoin, Observable, of } from 'rxjs' | 4 | import { forkJoin, Observable, of } from 'rxjs' |
5 | import { VideosOverview as VideosOverviewServer, peertubeTranslate } from '../../../../../shared/models' | 5 | import { VideosOverview as VideosOverviewServer, peertubeTranslate } from '../../../../../shared/models' |
@@ -21,9 +21,12 @@ export class OverviewService { | |||
21 | private serverService: ServerService | 21 | private serverService: ServerService |
22 | ) {} | 22 | ) {} |
23 | 23 | ||
24 | getVideosOverview (): Observable<VideosOverview> { | 24 | getVideosOverview (page: number): Observable<VideosOverview> { |
25 | let params = new HttpParams() | ||
26 | params = params.append('page', page + '') | ||
27 | |||
25 | return this.authHttp | 28 | return this.authHttp |
26 | .get<VideosOverviewServer>(OverviewService.BASE_OVERVIEW_URL + 'videos') | 29 | .get<VideosOverviewServer>(OverviewService.BASE_OVERVIEW_URL + 'videos', { params }) |
27 | .pipe( | 30 | .pipe( |
28 | switchMap(serverVideosOverview => this.updateVideosOverview(serverVideosOverview)), | 31 | switchMap(serverVideosOverview => this.updateVideosOverview(serverVideosOverview)), |
29 | catchError(err => this.restExtractor.handleError(err)) | 32 | catchError(err => this.restExtractor.handleError(err)) |