소스 검색

refac: pipelines

Timothy J. Baek 11 달 전
부모
커밋
2dbbd1bc6f
1개의 변경된 파일8개의 추가작업 그리고 4개의 파일을 삭제
  1. 8 4
      src/lib/components/admin/Settings/Pipelines.svelte

+ 8 - 4
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(',');
+			}
 		}
 	};