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

Like filter for non-String type (citext, for ex.) doesn't use constructed pattern #95

Open
daa opened this issue Apr 25, 2022 · 0 comments

Comments

@daa
Copy link
Contributor

daa commented Apr 25, 2022

When field being search is not of String type but similar (citext, for example) it's desirable to use _ilike filter but the code constructing filter doesn't use constructed pattern in this case - it uses just value:

switch (getFinalType(field.type).name) {
case 'String':
operation = operation || '_ilike';
operator = {
[operation]: operation.includes('like')
? `%${obj[key]}%`
: obj[key],
};
filter = set({}, keyName.split(SPLIT_TOKEN), operator);
break;
default:
operator = {
[operation]: operation.includes('like')
? `%${obj[key]}%`
: obj[key],
};
filter = set({}, keyName.split(SPLIT_TOKEN), {
[operation || '_eq']: obj[key],
});
}

So when I set up filter using TextInput with source=field@_like for citext column actual search is performed by value but not %value%.

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

No branches or pull requests

1 participant