From 514afa595f672f9fadf0424825c797c72338620f Mon Sep 17 00:00:00 2001 From: Kavin Venkatachalam <50441969+kavinvenkatachalam@users.noreply.github.com> Date: Thu, 18 May 2023 17:26:30 +0530 Subject: [PATCH] Fixed bug on running query after renaming it (#6462) * Fixed issue on running query after renaming it * Fixed issue on renaming query after updating version --- frontend/src/Editor/Editor.jsx | 2 ++ frontend/src/_helpers/appUtils.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/Editor/Editor.jsx b/frontend/src/Editor/Editor.jsx index cccce7344d..aab8b70931 100644 --- a/frontend/src/Editor/Editor.jsx +++ b/frontend/src/Editor/Editor.jsx @@ -400,6 +400,8 @@ class EditorComponent extends React.Component { if (version?.id === this.state.app?.current_version_id) { (this.canUndo = false), (this.canRedo = false); } + useAppDataStore.getState().actions.updateEditingVersion(version); + this.setState( { editingVersion: version, diff --git a/frontend/src/_helpers/appUtils.js b/frontend/src/_helpers/appUtils.js index c333ec6340..480f30ecb1 100644 --- a/frontend/src/_helpers/appUtils.js +++ b/frontend/src/_helpers/appUtils.js @@ -887,7 +887,7 @@ export function previewQuery(_ref, query, editorState, calledFromQuery = false) } export function runQuery(_ref, queryId, queryName, confirmed = undefined, mode = 'edit') { - const query = useDataQueriesStore.getState().dataQueries.find((query) => query.name === queryName); + const query = useDataQueriesStore.getState().dataQueries.find((query) => query.id === queryId); let dataQuery = {}; if (query) {