diff --git a/packages/builder/src/components/integration/index.svelte b/packages/builder/src/components/integration/index.svelte index 9f7be43bcf..a83b9d4db0 100644 --- a/packages/builder/src/components/integration/index.svelte +++ b/packages/builder/src/components/integration/index.svelte @@ -24,6 +24,8 @@ export let editable = true export let height = 500 + let flowEditors = [] + $: urlDisplay = schema.urlDisplay && `${datasource.config.url}${ @@ -33,6 +35,12 @@ function updateQuery({ detail }) { query.fields[schema.type] = detail.value } + + function updateEditors(deleteIndex) { + for (let i = deleteIndex; i < query.fields.steps?.length - 1; i++) { + flowEditors[i].update(query.fields.steps[i + 1].value.value) + } + } {#if schema} @@ -93,8 +101,9 @@ Stage {index + 1} { + updateEditors(index) query.fields.steps.splice(index, 1) - query.fields.steps = query.fields.steps + query.fields.steps = [...query.fields.steps] }} icon="DeleteOutline" /> @@ -108,18 +117,17 @@ query.fields.steps[index].key = detail }} /> - {#key query.fields.steps.length} - { - query.fields.steps[index].value = detail - }} - /> - {/key} + { + query.fields.steps[index].value = detail + }} + />