aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/rest
diff options
context:
space:
mode:
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