From 111fdc267b36201cf1be1fdf91017005102b4a5e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 11 Mar 2020 16:41:38 +0100 Subject: Handle overview pagination in client --- client/src/app/shared/overview/overview.service.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'client/src/app/shared/overview') 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 @@ import { catchError, map, switchMap, tap } from 'rxjs/operators' -import { HttpClient } from '@angular/common/http' +import { HttpClient, HttpParams } from '@angular/common/http' import { Injectable } from '@angular/core' import { forkJoin, Observable, of } from 'rxjs' import { VideosOverview as VideosOverviewServer, peertubeTranslate } from '../../../../../shared/models' @@ -21,9 +21,12 @@ export class OverviewService { private serverService: ServerService ) {} - getVideosOverview (): Observable { + getVideosOverview (page: number): Observable { + let params = new HttpParams() + params = params.append('page', page + '') + return this.authHttp - .get(OverviewService.BASE_OVERVIEW_URL + 'videos') + .get(OverviewService.BASE_OVERVIEW_URL + 'videos', { params }) .pipe( switchMap(serverVideosOverview => this.updateVideosOverview(serverVideosOverview)), catchError(err => this.restExtractor.handleError(err)) -- cgit v1.2.3