You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of now, this lib does not support ordering on associated models. But this can be achieved quickly imo.
Proposed solution:
We should just look for the omitPrimaryKeyFromOrder argument, and then add primaryKeyField to the 'orderOption' variable and give that object to the model.paginate function.
We should not parse anything else. paginate parses the order argument and constructs the query.
Below code block is from normalizedOrder function -
As of now, this lib does not support ordering on associated models. But this can be achieved quickly imo.
Proposed solution:
We should just look for the
omitPrimaryKeyFromOrder
argument, and then addprimaryKeyField
to the 'orderOption' variable and give that object to the model.paginate function.We should not parse anything else. paginate parses the order argument and constructs the query.
Below code block is from
normalizedOrder
function -sequelize-cursor-pagination/src/utils.js
Line 39 in 6d5f8ba
We should remove this. ordering parameter for associated model can be nested many level.
ex. ordering =
[[{model:user, as: "users"}, "name", "ASC" ]]
Let me know if you have better approach to implement this feature.
I tried implementing this approach, worked for me.
The text was updated successfully, but these errors were encountered: