From 3f1d3328e2b6ae281bd4a518f765439891b600ce Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 9 Dec 2021 16:48:19 +0000 Subject: [PATCH] Add button context to execute query action --- .../PropertyControls/EventsEditor/actions/index.js | 6 ++++++ packages/client/src/utils/buttonActions.js | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js index 3931ebfaaf..828751fb30 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js @@ -55,6 +55,12 @@ export const getAvailableActions = (getAllActions = false) => { { name: "Execute Query", component: ExecuteQuery, + context: [ + { + label: "Query result", + value: "result", + }, + ], }, { name: "Trigger Automation", diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index b5441bc8b6..a1c09d1ed0 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -74,11 +74,12 @@ const navigationHandler = action => { const queryExecutionHandler = async action => { const { datasourceId, queryId, queryParams } = action.parameters - await executeQuery({ + const result = await executeQuery({ datasourceId, queryId, parameters: queryParams, }) + return { result } } const executeActionHandler = async (