diff --git a/ui/apps/everest/src/hooks/api/db-cluster/useCreateDbCluster.ts b/ui/apps/everest/src/hooks/api/db-cluster/useCreateDbCluster.ts index d30292650..26627a8f2 100644 --- a/ui/apps/everest/src/hooks/api/db-cluster/useCreateDbCluster.ts +++ b/ui/apps/everest/src/hooks/api/db-cluster/useCreateDbCluster.ts @@ -59,16 +59,17 @@ const formValuesToPayloadMapping = ( : dbPayload.pitrStorageLocation!.name, }, }), - ...(dbPayload.schedules?.length > 0 && { - schedules: dbPayload.schedules.map((schedule) => ({ - ...schedule, - schedule: cronConverter( - schedule.schedule, - Intl.DateTimeFormat().resolvedOptions().timeZone, - 'UTC' - ), - })), - }), + schedules: + dbPayload.schedules?.length > 0 + ? dbPayload.schedules.map((schedule) => ({ + ...schedule, + schedule: cronConverter( + schedule.schedule, + Intl.DateTimeFormat().resolvedOptions().timeZone, + 'UTC' + ), + })) + : undefined, }, engine: { type: dbTypeToDbEngine(dbPayload.dbType), diff --git a/ui/apps/everest/src/hooks/api/db-cluster/useUpdateDbCluster.ts b/ui/apps/everest/src/hooks/api/db-cluster/useUpdateDbCluster.ts index 3cecc9617..89ca2fcdf 100644 --- a/ui/apps/everest/src/hooks/api/db-cluster/useUpdateDbCluster.ts +++ b/ui/apps/everest/src/hooks/api/db-cluster/useUpdateDbCluster.ts @@ -51,16 +51,17 @@ const formValuesToPayloadOverrides = ( enabled: dbPayload.pitrEnabled, backupStorageName: pitrBackupStorageName, }, - ...(dbPayload.schedules?.length > 0 && { - schedules: dbPayload.schedules.map((schedule) => ({ - ...schedule, - schedule: cronConverter( - schedule.schedule, - Intl.DateTimeFormat().resolvedOptions().timeZone, - 'UTC' - ), - })), - }), + schedules: + dbPayload.schedules.length > 0 + ? dbPayload.schedules.map((schedule) => ({ + ...schedule, + schedule: cronConverter( + schedule.schedule, + Intl.DateTimeFormat().resolvedOptions().timeZone, + 'UTC' + ), + })) + : undefined, }, engine: { ...dbCluster.spec.engine,