Fetch schemas separately. (#2227)

This commit is contained in:
Bogdan
2017-02-23 14:02:40 -08:00
committed by GitHub
parent 0296158100
commit cad392eb76
2 changed files with 3 additions and 4 deletions

View File

@@ -112,10 +112,9 @@ ${this.props.queryEditor.schema}/${input}`;
const actualDbId = dbId || this.props.queryEditor.dbId;
if (actualDbId) {
this.setState({ schemaLoading: true });
const url = `/databasetablesasync/api/read?_flt_0_id=${actualDbId}`;
const url = `/superset/schemas/${actualDbId}/`;
$.get(url, (data) => {
const schemas = data.result[0].all_schema_names;
const schemaOptions = schemas.map((s) => ({ value: s, label: s }));
const schemaOptions = data.schemas.map((s) => ({ value: s, label: s }));
this.setState({ schemaOptions });
this.setState({ schemaLoading: false });
});