Skip to content

Commit

Permalink
Merge pull request #764 from Support-pl/dev-fixes
Browse files Browse the repository at this point in the history
fixed change of addons when changing ovh vps tariff
  • Loading branch information
639852 authored Sep 3, 2024
2 parents edd941f + ed41e25 commit 379b49d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/components/cloud/modules/ovh vps/openInstance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,21 @@ export default defineComponent({
try {
this.isSwitchLoading = true
const { price, resources } = this.tariffs[this.planCode]
const { price, resources, meta } = this.tariffs[this.planCode] ?? {}
const backupIndex = instance.config.addons.findIndex((key) => key.includes('backup'))
const snapshotIndex = instance.config.addons.findIndex((key) => key.includes('snapshot'))
if (backupIndex !== -1) {
const backup = meta.addons.find((key) => key.includes('backup'))
instance.config.addons.splice(backupIndex, 1, backup)
}
if (snapshotIndex !== -1) {
const snapshot = meta.addons.find((key) => key.includes('snapshot'))
instance.config.addons.splice(snapshotIndex, 1, snapshot)
}
instance.config.planCode = this.planCode.split(' ')[1]
instance.product = this.planCode
Expand Down

0 comments on commit 379b49d

Please sign in to comment.