Skip to content
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

fix: jsonb filter path issue #172

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cjam
Copy link

@cjam cjam commented Nov 8, 2024

  • added logic to handed operation path within jsonb filters

- added logic to handed operation path within jsonb filters
@cjam
Copy link
Author

cjam commented Nov 8, 2024

As per the docs shown here: https://github.com/hasura/ra-data-hasura/tree/master?tab=readme-ov-file#jsonb-filtering

This PR fixes an issue with the filter reducer for JSONB that wasn't parsing or using the operation path. Now the example:

<TextField label="Theme Color" source="users#preferences@_contains@ux#theme" />```

Should produce the correct result:

```json
{
  "where": {
    "_and": [
      {
        "users": {
          "preferences": {
            "_contains": {
              "ux": {
                "theme": "%TEXT"
              }
            }
          }
        }
      }
    ]
  },
  "limit": 10,
  "offset": 0,
  "order_by": {
    "id": "asc"
  }
}

Ideally I would've broken it out to make it testable, but because it uses the introspection results I decided to just make minimal changes to the code and confirm it's functioning on my own project.

@cjam
Copy link
Author

cjam commented Nov 19, 2024

@praveenweb is anyone maintaining this library anymore? Who would be able to approve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant