-
Notifications
You must be signed in to change notification settings - Fork 59
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
Double filters in querystring #100
Comments
Can confirm, we've got the exact same issue here: let filter = {
users: {
firstName: { contains: 'admin' },
isActive: { eq: true },
},
not: { users: { roles: { any: {} } } },
};
buildQuery({ filter }); results in: "?$filter=contains(users/firstName,'admin') and users/isActive eq true and contains(users/firstName,'admin') and users/isActive eq true and not(users/roles/any())" |
@techniq We also encounter the same issue here. Using version 7.0.3. import buildODataQueryFn from 'odata-query';
const query = {
filter: {
components: {
control_number: {
in: ['0158'],
},
component1_number: {
in: ['0179'],
},
component2_number: {
in: ['0187'],
},
},
},
};
const queryString = buildODataQueryFn(query)
console.log(queryString)
// ?$filter=components/control_number in ('0158') and components/component1_number in ('0179') and components/component2_number in ('0187') and components/control_number in ('0158') and components/component1_number in ('0179') and components/component2_number in ('0187') and components/control_number in ('0158') and components/component1_number in ('0179') and components/component2_number in ('0187') |
I'd be happy to review a PR, but to be honest, I don't have much time to dig into the issue. |
Hi Sean,
First of all, thanks for your package, it saves a lot of time creating those queries. I'm facing an issue that deeper objects result in double queries. Please consider the following object:
this results in the following querystring (with some enters for readability):
Am I doing something wrong or did I stumble upon a bug? I've tried several versions (6.7.1, 6.7.0, 6.6.0) but to no avail.
Thanks in advance
The text was updated successfully, but these errors were encountered: