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

Cannot query fields by NULL #53

Closed
joelalejandro opened this issue Mar 29, 2019 · 0 comments
Closed

Cannot query fields by NULL #53

joelalejandro opened this issue Mar 29, 2019 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@joelalejandro
Copy link
Member

The current implementation of filtersToKnex apparently converts null to 0, which isn't accurate. This prevents to lookup records by absent values.

    Object.keys(filters).forEach(key => {
      let value = filters[key];
      const operator = getOperator(filters[key]) || "=";

      if (value.substring(value.indexOf(":") + 1)) {
        value = value.substring(value.indexOf(":") + 1);
      }

      value = value !== "null" ? value : 0;

      processedFilters.push({
        value,
        operator,
        column: camelize(key)
      });
@joelalejandro joelalejandro added the bug Something isn't working label Mar 29, 2019
@joelalejandro joelalejandro self-assigned this Mar 29, 2019
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