Fixing filtering issues (#2223)

* Fixing filtering issues

* Fixing off by one error
This commit is contained in:
Maxime Beauchemin
2017-02-22 15:17:20 -08:00
committed by GitHub
parent aff524d843
commit 459f7160ac
2 changed files with 6 additions and 11 deletions

View File

@@ -56,7 +56,7 @@ export function getControlsState(state, form_data) {
// Removing invalid filters that point to a now inexisting column
if (control.type === 'FilterControl' && control.choices) {
const choiceValues = control.choices.map(c => c[0]);
formData[k] = control.value.filter(flt => choiceValues.indexOf(flt.col) > 0);
formData[k] = formData[k].filter(flt => choiceValues.indexOf(flt.col) >= 0);
}
if (typeof control.default === 'function') {