From 3d222a62f918e67adb6cac0bb295cffdde09d0ca Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 19 Oct 2021 09:45:04 +0100 Subject: [PATCH 1/2] Fix issue where external datasource action wasn't saving it's values --- .../SetupPanel/QueryParamSelector.svelte | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/components/automation/SetupPanel/QueryParamSelector.svelte b/packages/builder/src/components/automation/SetupPanel/QueryParamSelector.svelte index 7a4bda3047..dd3a7fe417 100644 --- a/packages/builder/src/components/automation/SetupPanel/QueryParamSelector.svelte +++ b/packages/builder/src/components/automation/SetupPanel/QueryParamSelector.svelte @@ -3,22 +3,38 @@ import { Select } from "@budibase/bbui" import DrawerBindableInput from "../../common/bindings/DrawerBindableInput.svelte" import AutomationBindingPanel from "../../common/bindings/ServerBindingPanel.svelte" + import { createEventDispatcher } from "svelte" + + const dispatch = createEventDispatcher() export let value export let bindings + const onChangeQuery = e => { + value.queryId = e.detail + dispatch("change", value) + } + + const onChange = (e, field) => { + console.log(field) + value[field.name] = e.detail + dispatch("change", value) + } + $: query = $queries.list.find(query => query._id === value?.queryId) $: parameters = query?.parameters ?? [] // Ensure any nullish queryId values get set to empty string so // that the select works $: if (value?.queryId == null) value = { queryId: "" } + $: console.log(value)