Skip to content

Commit

Permalink
Allow empty query strings (#45)
Browse files Browse the repository at this point in the history
* Allow empty query strings

* Review fixes
  • Loading branch information
alahwa authored Mar 29, 2018
1 parent 040fbe4 commit 61b2005
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/data_explorer/controllers/facets_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def deserialize(filter_arr):
A facet_name may be repeated if multiple filters are desired.
:return: A dict of facet_name:[facet_value] mappings.
"""
if not filter_arr:
if not filter_arr or filter_arr == [""]:
return {}
parsed_filter = {}
# filter_str looks like "Gender=male"
Expand Down
8 changes: 7 additions & 1 deletion ui/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,13 @@ class App extends Component {
// Remove facetValue from the list of filters for facetName
this.filterMap.set(facetName, this.removeFacet(currentFacetValues, facetValue));
}
this.facetsApi.facetsGet({filter: this.filterMapToArray(this.filterMap)}, this.facetsCallback);

let filterArray = this.filterMapToArray(this.filterMap);
if (filterArray) {
this.facetsApi.facetsGet({filter: filterArray}, this.facetsCallback);
} else {
this.facetsApi.facetsGet({}, this.facetsCallback)
}
}

removeFacet(valueList, facetValue) {
Expand Down

0 comments on commit 61b2005

Please sign in to comment.