From 33192ce4d12364a85cf3d4bc621472ba3636c327 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Mon, 16 Feb 2026 20:32:29 -0600 Subject: [PATCH] fix(cluster): ensure Replicas value is correctly converted to number in mode-form - Updated the mode-form component to convert the Replicas value to a number only if it is defined and not an empty string, improving data handling for Replicated mode. --- .../advanced/cluster/swarm-forms/mode-form.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/mode-form.tsx b/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/mode-form.tsx index 839f5d519..a6885a7e4 100644 --- a/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/mode-form.tsx +++ b/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/mode-form.tsx @@ -105,7 +105,14 @@ export const ModeForm = ({ id, type }: ModeFormProps) => { const modeData = formData.type === "Replicated" - ? { Replicated: { Replicas: formData.Replicas } } + ? { + Replicated: { + Replicas: + formData.Replicas !== undefined && formData.Replicas !== "" + ? Number(formData.Replicas) + : undefined, + }, + } : { Global: {} }; await mutateAsync({