-
Notifications
You must be signed in to change notification settings - Fork 53
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
Bugfix: $sort field set incorrectly in GET_LIST handler #84
Comments
nicholasnelson
pushed a commit
to nicholasnelson/ra-data-feathers
that referenced
this issue
Oct 24, 2018
Change format of the query object in GET_LIST From: ```js query: { '$sort[createdAt]': '-1' } ``` To: ```js query: { $sort': { 'createdAt': '-1' } } ``` Fixes bug when using Feathers Websocket transport Closes josx#84
nicholasnelson
pushed a commit
to nicholasnelson/ra-data-feathers
that referenced
this issue
Oct 24, 2018
Update tests to reflect needed change Change format of the query object in GET_LIST From: ```js query: { '$sort[createdAt]': '-1' } ``` To: ```js query: { $sort': { 'createdAt': '-1' } } ``` Fixes bug when using Feathers Websocket transport Closes josx#84
josx
pushed a commit
that referenced
this issue
Oct 24, 2018
Update tests to reflect needed change Change format of the query object in GET_LIST From: ```js query: { '$sort[createdAt]': '-1' } ``` To: ```js query: { $sort': { 'createdAt': '-1' } } ``` Fixes bug when using Feathers Websocket transport Closes #84
Closed
nicholasnelson
pushed a commit
to nicholasnelson/ra-data-feathers
that referenced
this issue
Feb 12, 2019
For an unknown reason, query params were being flattened in GET_LIST. This resulted in requests with nested query params failing. This commit removes the flattening. Fixes josx#84
nicholasnelson
pushed a commit
to nicholasnelson/ra-data-feathers
that referenced
this issue
Feb 12, 2019
For an unknown reason, query params were being flattened in GET_LIST. This resulted in requests with nested query params failing. This commit removes the flattening. Fixes josx#84
josx
pushed a commit
that referenced
this issue
Feb 12, 2019
For an unknown reason, query params were being flattened in GET_LIST. This resulted in requests with nested query params failing. This commit removes the flattening. Fixes #84
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In testing Websocket compatibility, I've found the following issue.
Feathers documentation shows the query format for $sort in GET_LIST as follows:
ra-data-feathers currently provides the $sort param like this:
This works for the REST transport, but not for Websocket.
I suspect this is because the REST transport on the server side parses
$sort[createdAt]: '-1'
to$sort: { createdAt: '-1' }
when the query string is parsed. When Websocket is being used, the query is not parsed (because it is sent directly as an object rather than a string).For example in my project which is backed by Sequelize, this results in a SQL query like
... WHERE '$sort[createdAt]' = '-1' ...
which then gives an error about the field '$sort[createdAt]' not existing.Updating GET_LIST to set the $sort parameter as in the Feathers documentation example above should resolve this issue.
The text was updated successfully, but these errors were encountered: