From 2dbbd1bc6feb7cfcee0fc7be168bbc0f7b84d899 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 31 May 2024 19:40:58 -0700 Subject: [PATCH] refac: pipelines --- src/lib/components/admin/Settings/Pipelines.svelte | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lib/components/admin/Settings/Pipelines.svelte b/src/lib/components/admin/Settings/Pipelines.svelte index 7be08e69c..35ea425be 100644 --- a/src/lib/components/admin/Settings/Pipelines.svelte +++ b/src/lib/components/admin/Settings/Pipelines.svelte @@ -40,8 +40,10 @@ const pipeline = pipelines[selectedPipelineIdx]; if (pipeline && (pipeline?.valves ?? false)) { - if (valves?.pipelines ?? false) { - valves.pipelines = valves.pipelines.split(',').map((v) => v.trim()); + for (const property in valves_spec.properties) { + if (valves_spec.properties[property]?.type === 'array') { + valves[property] = valves[property].split(',').map((v) => v.trim()); + } } const res = await updatePipelineValves( @@ -79,8 +81,10 @@ selectedPipelinesUrlIdx ); - if (valves?.pipelines ?? false) { - valves.pipelines = valves.pipelines.join(','); + for (const property in valves_spec.properties) { + if (valves_spec.properties[property]?.type === 'array') { + valves[property] = valves[property].join(','); + } } };