avo icon indicating copy to clipboard operation
avo copied to clipboard

Implement dynamic filters group management (and, or)

Open Paul-Bob opened this issue 7 months ago • 3 comments

This feature will let users create groups of filters and choose between "AND" or "OR" operators to refine their search criteria.

### Tasks
- [ ] https://github.com/avo-hq/avo/issues/2987
- [ ] search through dynamic filters (can become a big list)
- [ ] https://github.com/avo-hq/avo/issues/2988

One API could be this one:

# this reads like so:
# first_name or last name or group_1 (age and sex and group 2 (hair or height))
{
  "filters" => {
    "first_name" => {"is" => ["11", "22"], "is_not" => ["22"]},
    "last_name" => {
      "operator" => "or",
      "is_not" => ["22"]
    },
    "group_1" => {
      "operator" => "or"
      "filters" => {
        "age" => {"is_not" => ["22"]},
        "sex" => {"is_not" => ["22"]},
        "group_2" => {
          "filters" => {
            "hair" => {"is_not" => ["22"]}
            "height" => {"operator" => "or", "is_not" => ["22"]}
          }
        }
      }
    }
  }
  ,"controller" => "avo/projects", "action" => "index"
}

https://avodemo.com/avo/resources/projects?filters[stage][is][]=discovery&filters[country][is][]=AF&filters[country][_operator][]=and|or

Paul-Bob avatar Jul 12 '24 18:07 Paul-Bob