-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"limit=-1 must be "enabled" with maxLimit=-1" as per #393 not working #958
Comments
Thanks for the report, could you open a PR that adds a failing test case for this? From there, fixing it will be easier :) |
@Helveg my proposed change would be following -
Nevertheless it changes the behaviour of the test "should limit to defaultLimit, if limit is differt FROM NO_PAGINATION ecc...." But for me it would be the more correct logic to apply the limit if it was given in the query, regardless of the config of "maxLimit" |
yep. definitely also how I had it envisioned :) let's roll with it. breaking changes ftw :) could you add to PR? |
Hey!
I think the changes made in #393 are not fully correct.
SHOULD:
My expectation would be that "maxLimit=-1" would enable the caller to use no pagination if he wants to with "limit=-1".
My expecation would be that the standardfunctionality with e.g. "limit=2" would still work regardless of maxLimit definition
IS:
If I set maxLimit=-1 and limit=2 it will currently give me all entries (hence no pagination) which is not the expected behaviour from my POV.
Using: 9.0.1
I think the issue is somewhere here:
nestjs-paginate/src/paginate.ts
Line 203 in 25fca93
It will result in const limit = -1
BR Jakob
The text was updated successfully, but these errors were encountered: