aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/rest
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-01-08 14:40:08 +0100
committerChocobozzz <me@florianbigard.com>2020-01-08 14:40:08 +0100
commit440d39c52d4efb878b6a2e21584d6b8f52072f27 (patch)
tree19ffd2dd545e125daf89c230e33d15f7827d10f7 /client/src/app/shared/rest
parentfe98765624cdd6695739bda719fcb726b71c2b2a (diff)
downloadPeerTube-440d39c52d4efb878b6a2e21584d6b8f52072f27.tar.gz
PeerTube-440d39c52d4efb878b6a2e21584d6b8f52072f27.tar.zst
PeerTube-440d39c52d4efb878b6a2e21584d6b8f52072f27.zip
Skip videos count on client if we don't use it
Diffstat (limited to 'client/src/app/shared/rest')
-rw-r--r--client/src/app/shared/rest/component-pagination.model.ts4
-rw-r--r--client/src/app/shared/rest/rest.service.ts4
2 files changed, 5 insertions, 3 deletions
diff --git a/client/src/app/shared/rest/component-pagination.model.ts b/client/src/app/shared/rest/component-pagination.model.ts
index 85160d445..bcb73ed0f 100644
--- a/client/src/app/shared/rest/component-pagination.model.ts
+++ b/client/src/app/shared/rest/component-pagination.model.ts
@@ -1,9 +1,11 @@
1export interface ComponentPagination { 1export interface ComponentPagination {
2 currentPage: number 2 currentPage: number
3 itemsPerPage: number 3 itemsPerPage: number
4 totalItems?: number 4 totalItems: number
5} 5}
6 6
7export type ComponentPaginationLight = Omit<ComponentPagination, 'totalItems'>
8
7export function hasMoreItems (componentPagination: ComponentPagination) { 9export function hasMoreItems (componentPagination: ComponentPagination) {
8 // No results 10 // No results
9 if (componentPagination.totalItems === 0) return false 11 if (componentPagination.totalItems === 0) return false
diff --git a/client/src/app/shared/rest/rest.service.ts b/client/src/app/shared/rest/rest.service.ts
index e6d4e6e5e..16bb6d82c 100644
--- a/client/src/app/shared/rest/rest.service.ts
+++ b/client/src/app/shared/rest/rest.service.ts
@@ -1,7 +1,7 @@
1import { Injectable } from '@angular/core' 1import { Injectable } from '@angular/core'
2import { HttpParams } from '@angular/common/http' 2import { HttpParams } from '@angular/common/http'
3import { SortMeta } from 'primeng/components/common/sortmeta' 3import { SortMeta } from 'primeng/components/common/sortmeta'
4import { ComponentPagination } from './component-pagination.model' 4import { ComponentPagination, ComponentPaginationLight } from './component-pagination.model'
5 5
6import { RestPagination } from './rest-pagination' 6import { RestPagination } from './rest-pagination'
7 7
@@ -47,7 +47,7 @@ export class RestService {
47 return params 47 return params
48 } 48 }
49 49
50 componentPaginationToRestPagination (componentPagination: ComponentPagination): RestPagination { 50 componentPaginationToRestPagination (componentPagination: ComponentPaginationLight): RestPagination {
51 const start: number = (componentPagination.currentPage - 1) * componentPagination.itemsPerPage 51 const start: number = (componentPagination.currentPage - 1) * componentPagination.itemsPerPage
52 const count: number = componentPagination.itemsPerPage 52 const count: number = componentPagination.itemsPerPage
53 53