From 69eae1ccd511ee340e9e5e8da9e3bf9b07ef64d0 Mon Sep 17 00:00:00 2001 From: AAfghahi <48933336+AAfghahi@users.noreply.github.com> Date: Mon, 10 Jan 2022 17:28:24 -0500 Subject: [PATCH] Update superset-frontend/src/SqlLab/actions/sqlLab.js Co-authored-by: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com> --- superset-frontend/src/SqlLab/actions/sqlLab.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/superset-frontend/src/SqlLab/actions/sqlLab.js b/superset-frontend/src/SqlLab/actions/sqlLab.js index 43d63addfc8a3..2605c43e739fc 100644 --- a/superset-frontend/src/SqlLab/actions/sqlLab.js +++ b/superset-frontend/src/SqlLab/actions/sqlLab.js @@ -865,21 +865,22 @@ export function saveQuery(query) { stringify: false, }) .then(result => { + const savedQuery = convertQueryToClient(result.json.item); dispatch({ type: QUERY_EDITOR_SAVED, query, - result: convertQueryToClient(result.json.item), + result: savedQuery, }); dispatch(queryEditorSetTitle(query, query.title)); - return convertQueryToClient(result.json.item); + return savedQuery; }) .catch(() => dispatch(addDangerToast(t('Your query could not be saved'))), ); } -export function addSavedQueryToTabState(queryEditor, savedQuery) { - return function (dispatch) { +export const addSavedQueryToTabState = + (queryEditor, savedQuery) => dispatch => { const sync = isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE) ? SupersetClient.put({ endpoint: `/tabstateview/${queryEditor.id}`, @@ -895,7 +896,6 @@ export function addSavedQueryToTabState(queryEditor, savedQuery) { dispatch(addSuccessToast(t('Your query was saved'))); }); }; -} export function updateSavedQuery(query) { return dispatch =>