Skip to content

Commit

Permalink
Merge pull request #528 from Hexastack/527-issue-pagination-querypipe…
Browse files Browse the repository at this point in the history
…-issue

[MERGE ORDER 1] fix: resolve pagination-querypipe null checks issues
  • Loading branch information
marrouchi authored Jan 7, 2025
2 parents f27d7fb + 7e227d0 commit 9515b87
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/src/utils/pagination/pagination-query.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9515b87

Please sign in to comment.