From 2eb95277ab51a997e974c8f403f83ea88285bdd1 Mon Sep 17 00:00:00 2001 From: "Robert St. John" Date: Sat, 2 Nov 2024 19:04:20 -0600 Subject: [PATCH] refactor(service): users/auth: better name for paging links function --- service/src/entities/entities.global.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/src/entities/entities.global.ts b/service/src/entities/entities.global.ts index af69592f3..e728b6238 100644 --- a/service/src/entities/entities.global.ts +++ b/service/src/entities/entities.global.ts @@ -91,7 +91,7 @@ export interface Links { prev: number | null } -export function calculateLinks(paging: PagingParameters, totalCount: number | null): Links { +export function calculatePagingLinks(paging: PagingParameters, totalCount: number | null): Links { const limit = paging.pageSize const start = paging.pageIndex * limit const next = start + paging.pageSize < (totalCount || 0) ? paging.pageIndex + 1 : null @@ -101,7 +101,7 @@ export function calculateLinks(paging: PagingParameters, totalCount: number | nu export const pageOf = (items: T[], paging: PagingParameters, totalCount?: number | null): PageOf => { const resolvedTotalCount = totalCount || 0; - const links = calculateLinks(paging, resolvedTotalCount) + const links = calculatePagingLinks(paging, resolvedTotalCount) return { totalCount: totalCount || null, pageSize: typeof paging.pageSize === 'number' ? paging.pageSize : -1,