Skip to content

Commit

Permalink
Update superset-frontend/src/SqlLab/actions/sqlLab.js
Browse files Browse the repository at this point in the history
Co-authored-by: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com>
  • Loading branch information
AAfghahi and lyndsiWilliams committed Jan 13, 2022
1 parent ed14a6f commit 69eae1c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions superset-frontend/src/SqlLab/actions/sqlLab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
Expand All @@ -895,7 +896,6 @@ export function addSavedQueryToTabState(queryEditor, savedQuery) {
dispatch(addSuccessToast(t('Your query was saved')));
});
};
}

export function updateSavedQuery(query) {
return dispatch =>
Expand Down

0 comments on commit 69eae1c

Please sign in to comment.