-
Notifications
You must be signed in to change notification settings - Fork 74
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
Paginate
option for a feathers-sequelize service is not working as expected
#186
Comments
Just ran into this issue myself. If I turn off pagination in a hook by setting params.paginate = false there it works. But if I turn it off when initializing the service it does not. |
I can confirm that I am also experiencing this, and I successfully used the same fix as @katerina-semikina @ninique the hook fix also works, since the hook param for |
I ran into this myself. The issue is line 18 in Removing the default `|| {}' should fix the issue. |
That should do it. Pull request welcome. |
Opened #217 |
Steps to reproduce
If paginate option is set to false for a service, count query is still created while calling find service method.
Example:
Expected behavior
Model.findAll
is invoked instead ifModel.findAndCountAll
.Actual behavior
Model.findAndCountAll
is invoked. Extra count query is executed.The reason is the following case:
If
options.paginate
isfalse
, thenthis.paginate
becomes equal to{}
.link to the line
find
method:If
params.paginate
is undefined, thenthis.paginate
value is assigned topaginate
variable, sopaginate
becomes equal to{}
.link to the line
_find
method:If
paginate
is{}
, then the condition is true, soModel.findAndCountAll
is called.link to the line
System configuration
Feathers-sequelize version: 2.3.0
NodeJS version: 8.1.2
Operating System: macOS 10.12.6
The text was updated successfully, but these errors were encountered: