From 7322d2172129d0ac31490fd4e61c4df65b368dba Mon Sep 17 00:00:00 2001 From: yassinedorbozgithub Date: Tue, 7 Jan 2025 05:12:48 +0100 Subject: [PATCH] fix: resolve pagination-querypipe null checks issues --- api/src/utils/pagination/pagination-query.pipe.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/src/utils/pagination/pagination-query.pipe.ts b/api/src/utils/pagination/pagination-query.pipe.ts index c69076a1..82716f8c 100644 --- a/api/src/utils/pagination/pagination-query.pipe.ts +++ b/api/src/utils/pagination/pagination-query.pipe.ts @@ -23,9 +23,10 @@ export class PageQueryPipe let skip: number | undefined = undefined; let limit: number | undefined = undefined; if ('limit' in value) { - skip = parseInt(value.skip) > -1 ? parseInt(value.skip) : 0; + skip = + value?.skip && parseInt(value.skip) > -1 ? parseInt(value.skip) : 0; limit = - parseInt(value.limit) > 0 + value?.limit && parseInt(value.limit) > 0 ? parseInt(value.limit) : config.pagination.limit; }