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

Unable to filter enum fields for multiple values #122

Open
rlamorea opened this issue Sep 13, 2023 · 1 comment
Open

Unable to filter enum fields for multiple values #122

rlamorea opened this issue Sep 13, 2023 · 1 comment

Comments

@rlamorea
Copy link

If I try a filtered URL like:

https://my.adminjs.server/admin/resources/myresource?filters.enumField=foo&filters.enumField=bar

The query only looks for WHERE enumField = 'foo'

This is because of line 16 in @adminjs/sequelize/lib/utils/convert-filter.js:

 if (property.sequelizePath.values || uuidRegex.test(value.toString())) {

Since it is an enum field, this intercepts before it gets to the check for isArray and returns an Op.eq where clause instead of an Op.in clause.

@rlamorea
Copy link
Author

Note that this line would also prevent the selection of multiple UUIDs if I am reading it correctly.

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