Skip to content

Commit

Permalink
only fetch tables if we have a schema, otherwise reset options. (#2490)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alanna Scott committed Mar 27, 2017
1 parent 7eafbab commit 93551a6
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ ${this.props.queryEditor.schema}/${input}`;
}
// TODO: move fetching methods to the actions.
fetchTables(dbId, schema, substr) {
if (dbId) {
if (dbId && schema) {
this.setState({ tableLoading: true, tableOptions: [] });
const url = `/superset/tables/${dbId}/${schema}/${substr}/`;
$.get(url, (data) => {
Expand All @@ -75,6 +75,8 @@ ${this.props.queryEditor.schema}/${input}`;
tableLength: data.tableLength,
});
});
} else {
this.setState({ tableLoading: false, tableOptions: [] });
}
}
changeTable(tableOpt) {
Expand Down

0 comments on commit 93551a6

Please sign in to comment.