fix: resolve pagination-querypipe null checks issues

This commit is contained in:
yassinedorbozgithub 2025-01-07 05:12:48 +01:00
parent 2910de0058
commit 7322d21721

View File

@ -23,9 +23,10 @@ export class PageQueryPipe<T>
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;
}