From 0f67e9e2223c20d84ae1f4fa784c9f23ca17cc6e Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Tue, 29 Apr 2025 22:56:11 -0600 Subject: [PATCH] Refactor HandleBackup component to improve database selection logic. Simplify the initialization of the database field in the form by using a conditional expression for better readability and maintainability. --- .../dashboard/database/backups/handle-backup.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/dokploy/components/dashboard/database/backups/handle-backup.tsx b/apps/dokploy/components/dashboard/database/backups/handle-backup.tsx index 2d8a6b6d..1717aebc 100644 --- a/apps/dokploy/components/dashboard/database/backups/handle-backup.tsx +++ b/apps/dokploy/components/dashboard/database/backups/handle-backup.tsx @@ -228,8 +228,11 @@ export const HandleBackup = ({ useEffect(() => { form.reset({ - database: - (backup?.database ?? databaseType === "web-server") ? "dokploy" : "", + database: backup?.database + ? backup?.database + : databaseType === "web-server" + ? "dokploy" + : "", destinationId: backup?.destinationId ?? "", enabled: backup?.enabled ?? true, prefix: backup?.prefix ?? "/",