Fixing exploring a table (#2233)

This commit is contained in:
Maxime Beauchemin
2017-02-23 08:58:27 -08:00
committed by GitHub
parent dc05be36a6
commit 2fbadea9e3

View File

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