From 159cc9d277d4418a4946a96a831b206532e197c8 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 4 May 2022 15:26:19 +0100 Subject: [PATCH] Fixes for #4736 - I believe the issue was that the dynamic variables were not being saved, removing the need for the user to be aware of this, also making it possible to pass the entire data structure from one call to another if desired. --- .../_components/DynamicVariableModal.svelte | 4 ++++ .../datasource/[selectedDatasource]/rest/[query]/index.svelte | 1 + packages/string-templates/src/helpers/index.js | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/_components/DynamicVariableModal.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/_components/DynamicVariableModal.svelte index 61d0a1993c..5c0cd0f883 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/_components/DynamicVariableModal.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/_components/DynamicVariableModal.svelte @@ -1,5 +1,8 @@ diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte index e870c2f6db..2baa6aab41 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte @@ -299,6 +299,7 @@ {dynamicVariables} bind:binding={varBinding} bind:this={addVariableModal} + on:change={saveQuery} /> {#if query && queryConfig}
diff --git a/packages/string-templates/src/helpers/index.js b/packages/string-templates/src/helpers/index.js index ad4082e3a4..2d5b910847 100644 --- a/packages/string-templates/src/helpers/index.js +++ b/packages/string-templates/src/helpers/index.js @@ -25,7 +25,7 @@ const HELPERS = [ if ( value != null && typeof value === "object" && - value.toString() === "[object Object]" + (value.toString() === "[object Object]" || Array.isArray(value)) ) { return new SafeString(JSON.stringify(value)) }