From f833c1a5a0424934a694141d3115d9cdaf4f3c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Wed, 28 Apr 2021 15:18:12 +0200 Subject: [PATCH] fix dataBinding error --- .../builder/src/builderStore/dataBinding.js | 2 +- .../EventsEditor/actions/ExecuteQuery.svelte | 68 ++++++++++--------- 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index 4d57311f5f..dae22dbf1b 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -252,7 +252,7 @@ export const getSchemaForDatasource = (datasource, isForm = false) => { if (datasource) { const { type } = datasource if (type === "query") { - const queries = get(queriesStores).queries + const queries = get(queriesStores).list table = queries.find(query => query._id === datasource._id) } else { const tables = get(tablesStore).list diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/ExecuteQuery.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/ExecuteQuery.svelte index 460267f561..4cfbce4da0 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/ExecuteQuery.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/ExecuteQuery.svelte @@ -1,5 +1,5 @@ - - query.datasourceId === datasource._id)} - getOptionLabel={query => query.name} - getOptionValue={query => query._id} /> -{/if} + bind:value={parameters.datasourceId} + option={$datasources.list} + getOptionLabel={(source) => source.name} + getOptionValue={(source) => source._id} + /> - + {#if parameters.datasourceId} + +