aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/overview
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-03-11 16:41:38 +0100
committerChocobozzz <me@florianbigard.com>2020-03-11 16:45:09 +0100
commit111fdc267b36201cf1be1fdf91017005102b4a5e (patch)
tree5ea98f766cc74de3434a855e998e763324e9da72 /client/src/app/shared/overview
parent764a965778ac89e027fd05dd35697c6763e0dc18 (diff)
downloadPeerTube-111fdc267b36201cf1be1fdf91017005102b4a5e.tar.gz
PeerTube-111fdc267b36201cf1be1fdf91017005102b4a5e.tar.zst
PeerTube-111fdc267b36201cf1be1fdf91017005102b4a5e.zip
Handle overview pagination in client
Diffstat (limited to 'client/src/app/shared/overview')
-rw-r--r--client/src/app/shared/overview/overview.service.ts9
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 @@
1import { catchError, map, switchMap, tap } from 'rxjs/operators' 1import { catchError, map, switchMap, tap } from 'rxjs/operators'
2import { HttpClient } from '@angular/common/http' 2import { HttpClient, HttpParams } from '@angular/common/http'
3import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { forkJoin, Observable, of } from 'rxjs' 4import { forkJoin, Observable, of } from 'rxjs'
5import { VideosOverview as VideosOverviewServer, peertubeTranslate } from '../../../../../shared/models' 5import { 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))