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

[BUG] [Supabase] When a "in" filter is nested it is parsed incorrectly #6651

Open
jkronlachner opened this issue Jan 17, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@jkronlachner
Copy link

jkronlachner commented Jan 17, 2025

Describe the bug

If a LogicalFilter with the operator in is used inside a ConditionalFilter or the array value is parsed incorrectly by the generateFilter Method.

When passing a array outside of a LogicalFilter it parses correctly.

Steps To Reproduce

I am using the following Filter configuration:

{
        operator: 'or',
        value: [
        {
           field: "id",
           operator: 'in',
           value: [1,2,3],
        },
        ... more filters
    ],
},

This is sending the following to supabase as filter:
http://127.0.0.1:54321/rest/v1/company?select=*&offset=0&limit=30&or=(id.in."1","2","4")

Supabase then throws the follwing error:

{
    "code": "PGRST100",
    "details": "unexpected \"1\" expecting \"(\"",
    "hint": null,
    "message": "\"failed to parse logic tree ((id.in.1,2,4))\" (line 1, column 10)"
}

Expected behavior

This is missing the parentheses around the array. It should look like this:
http://127.0.0.1:54321/rest/v1/company?select=*&offset=0&limit=30&or=(id.in.("1","2","4"))

Packages

  • @refinedev/supabase

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant