From 2c8b8995582600ba7d57d2b36dbe0a57ae8b7010 Mon Sep 17 00:00:00 2001 From: Mohamed Alnahhas Date: Tue, 12 May 2026 20:08:03 +0200 Subject: [PATCH] refactor: refactor addTestCommand to handle initial values --- .../advanced/cluster/swarm-forms/health-check-form.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/health-check-form.tsx b/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/health-check-form.tsx index 06c8eb94a6..fae7966f84 100644 --- a/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/health-check-form.tsx +++ b/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/health-check-form.tsx @@ -127,7 +127,8 @@ export const HealthCheckForm = ({ id, type }: HealthCheckFormProps) => { }; const addTestCommand = () => { - form.setValue("Test", [...testCommands, ""]); + const newItems = testCommands.length === 0 ? ["", ""] : [""]; + form.setValue("Test", [...testCommands, ...newItems]); }; const updateTestCommand = (index: number, value: string) => {