From 4635f59d7c3fea4b97029f10886c62fdf38b2084 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 27 Dec 2017 16:11:53 +0100 Subject: Add video comment components --- client/src/app/shared/rest/rest.service.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'client/src/app/shared/rest/rest.service.ts') diff --git a/client/src/app/shared/rest/rest.service.ts b/client/src/app/shared/rest/rest.service.ts index a1c301050..5d5410de9 100644 --- a/client/src/app/shared/rest/rest.service.ts +++ b/client/src/app/shared/rest/rest.service.ts @@ -1,6 +1,7 @@ import { Injectable } from '@angular/core' import { HttpParams } from '@angular/common/http' import { SortMeta } from 'primeng/components/common/sortmeta' +import { ComponentPagination } from './component-pagination.model' import { RestPagination } from './rest-pagination' @@ -31,4 +32,10 @@ export class RestService { return newParams } + componentPaginationToRestPagination (componentPagination: ComponentPagination): RestPagination { + const start: number = (componentPagination.currentPage - 1) * componentPagination.itemsPerPage + const count: number = componentPagination.itemsPerPage + + return { start, count } + } } -- cgit v1.2.3