diff --git a/ui/src/views/compute/ScaleVM.vue b/ui/src/views/compute/ScaleVM.vue index 6171c1f3262..125e753b23a 100644 --- a/ui/src/views/compute/ScaleVM.vue +++ b/ui/src/views/compute/ScaleVM.vue @@ -153,29 +153,22 @@ export default { handleSubmit () { this.loading = true - const apiName = this.resource.state === 'Stopped' ? 'changeServiceForVirtualMachine' : 'scaleVirtualMachine' if ('cpuspeed' in this.selectedOffering && this.selectedOffering.iscustomized) { delete this.params[this.cpuSpeedKey] } - api(apiName, this.params).then(response => { - if (apiName === 'scaleVirtualMachine') { - const jobId = response.scalevirtualmachineresponse.jobid - if (jobId) { - this.$pollJob({ - jobId, - successMethod: result => { - this.$notification.success({ - message: this.$t('message.success.change.offering') - }) - }, - loadingMessage: this.$t('message.scale.processing'), - catchMessage: this.$t('error.fetching.async.job.result') - }) - } - } else { - this.$notification.success({ - message: this.$t('message.success.change.offering') + api('scaleVirtualMachine', this.params).then(response => { + const jobId = response.scalevirtualmachineresponse.jobid + if (jobId) { + this.$pollJob({ + jobId, + successMethod: result => { + this.$notification.success({ + message: this.$t('message.success.change.offering') + }) + }, + loadingMessage: this.$t('message.scale.processing'), + catchMessage: this.$t('error.fetching.async.job.result') }) } this.$parent.$parent.close()