Merge pull request #528 from Hexastack/527-issue-pagination-querypipe-issue
Some checks are pending
Build and Push Docker API Image / build-and-push (push) Waiting to run
Build and Push Docker Base Image / build-and-push (push) Waiting to run
Build and Push Docker UI Image / build-and-push (push) Waiting to run

[MERGE ORDER 1] fix: resolve pagination-querypipe null checks issues
This commit is contained in:
Med Marrouchi 2025-01-07 17:01:54 +01:00 committed by GitHub
commit 9515b87875
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,10 +22,10 @@ export class PageQueryPipe<T>
transform(value: PageQueryParams) {
let skip: number | undefined = undefined;
let limit: number | undefined = undefined;
if ('limit' in value) {
skip = parseInt(value.skip) > -1 ? parseInt(value.skip) : 0;
if (value && 'limit' in value) {
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;
}