From 04058fa29e2f84ebfa1000ae0a4de7f7aaf087cd Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sun, 17 Mar 2024 14:10:31 +0100 Subject: [PATCH] fix: improve default value for approval flows --- .../src/lib/components/FlowStatusWaitingForEvents.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/FlowStatusWaitingForEvents.svelte b/frontend/src/lib/components/FlowStatusWaitingForEvents.svelte index c0d9720f7c..c207bfb58b 100644 --- a/frontend/src/lib/components/FlowStatusWaitingForEvents.svelte +++ b/frontend/src/lib/components/FlowStatusWaitingForEvents.svelte @@ -17,6 +17,7 @@ $: approvalStep = (job?.flow_status?.step ?? 1) - 1 + let defaultValues = {} $: job && getDefaultArgs() async function getDefaultArgs() { @@ -28,7 +29,10 @@ workspace: workspaceId ?? $workspaceStore ?? '', id: jobId }) - default_payload = job_result?.default_args ?? {} + const args = job_result?.default_args ?? {} + defaultValues = JSON.parse(JSON.stringify(args)) + default_payload = args + enum_payload = job_result?.enums ?? {} resumeUrl = job_result?.['resume'] } @@ -93,6 +97,7 @@