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)