fix: sqllab schema select error msg (#18564)

* fix: sqllab schema select error msg

* remove console logs

* fix lint
This commit is contained in:
Phillip Kelley-Dotson
2022-02-04 10:21:18 -08:00
committed by GitHub
parent 6cad7b1d05
commit 151d30bea4

View File

@@ -776,12 +776,14 @@ export function queryEditorSetDb(queryEditor, dbId) {
export function queryEditorSetSchema(queryEditor, schema) {
return function (dispatch) {
const sync = isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE)
? SupersetClient.put({
endpoint: encodeURI(`/tabstateview/${queryEditor.id}`),
postPayload: { schema },
})
: Promise.resolve();
const sync =
isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE) &&
typeof queryEditor === 'object'
? SupersetClient.put({
endpoint: encodeURI(`/tabstateview/${queryEditor.id}`),
postPayload: { schema },
})
: Promise.resolve();
return sync
.then(() =>