fix shared query (#16753)

This commit is contained in:
Elizabeth Thompson
2021-09-21 09:38:23 -07:00
committed by GitHub
parent a8d5342953
commit f032cc254c
2 changed files with 26 additions and 24 deletions

View File

@@ -898,6 +898,8 @@ export function updateSavedQuery(query) {
export function queryEditorSetSql(queryEditor, sql) {
return function (dispatch) {
// saved query and set tab state use this action
dispatch({ type: QUERY_EDITOR_SET_SQL, queryEditor, sql });
if (isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE)) {
return SupersetClient.put({
endpoint: encodeURI(`/tabstateview/${queryEditor.id}`),
@@ -914,7 +916,7 @@ export function queryEditorSetSql(queryEditor, sql) {
),
);
}
return dispatch({ type: QUERY_EDITOR_SET_SQL, queryEditor, sql });
return Promise.resolve();
};
}