Skip to content

Commit

Permalink
fix(xo-server/xo-web/mirrorBackup): correct new schedule property on …
Browse files Browse the repository at this point in the history
…edited mirror backup job (#8001)

Introduced by ee0adae
  • Loading branch information
MelissaFrncJrg authored Sep 26, 2024
1 parent 6b21f08 commit 943ad78
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,6 @@
- xen-api minor
- xo-cli minor
- xo-server minor
- xo-web patch

<!--packages-end-->
4 changes: 0 additions & 4 deletions packages/xo-server/src/api/mirror-backup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ editJob.params = {
remotes: {
type: 'object',
},
schedules: {
type: 'object',
optional: true,
},
filter: MIRROR_BACKUP_FILTER,
settings: SCHEMA_SETTINGS,
}
Expand Down
7 changes: 3 additions & 4 deletions packages/xo-web/src/xo-app/backup/new/mirror/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ const NewMirrorBackup = decorate([
}

const settings = { ...state.settings }
const schedules = { ...state.schedules }
await Promise.all([
...map(props.schedules, ({ id }) => {
const schedule = state.schedules[id]
Expand All @@ -214,16 +213,16 @@ const NewMirrorBackup = decorate([
enabled: schedule.enabled,
})
settings[newSchedule.id] = settings[schedule.id]
schedules[newSchedule.id] = newSchedule
delete settings[schedule.id]
delete schedules[schedule.id]
}
}),
])

const { schedules, ...jobProps } = normalize({ ...state, settings, isIncremental: state.isIncremental })

await editMirrorBackupJob({
id: props.job.id,
...normalize({ ...state, settings, schedules, isIncremental: state.isIncremental }),
...jobProps,
})
},
resetMirrorBackup: () => (_, props) => getInitialState(props),
Expand Down

0 comments on commit 943ad78

Please sign in to comment.