Fix createDatasource (#7955)

This commit is contained in:
Beto Dealmeida 2019-08-01 01:01:46 -07:00 committed by Ville Brofeldt
parent 10f00cdde3
commit a09f258379
1 changed files with 3 additions and 3 deletions

View File

@ -530,10 +530,10 @@ export function createDatasource(vizOptions) {
endpoint: '/superset/sqllab_viz/',
postPayload: { data: vizOptions },
})
.then(({ data }) => {
dispatch(createDatasourceSuccess(data));
.then(({ json }) => {
dispatch(createDatasourceSuccess(json));
return Promise.resolve(data);
return Promise.resolve(json);
})
.catch(() => {
dispatch(createDatasourceFailed(t('An error occurred while creating the data source')));