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.

This commit is contained in:
Mauricio Siu 2025-04-29 22:56:11 -06:00
parent c4045795ee
commit 0f67e9e222

View File

@ -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 ?? "/",