migratewizard: Fix fetching jobid from api response (#913)

* migratewizard: Display error and unfreeze form when api call fails

* migratewizard: Fix fetching jobid from api response

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
davidjumani 2021-01-08 17:42:19 +05:30 committed by Rohit Yadav
parent 123291fd04
commit beeb34b007
1 changed files with 3 additions and 2 deletions

View File

@ -153,14 +153,15 @@ export default {
hostid: this.selectedHost.id,
virtualmachineid: this.resource.id
}).then(response => {
const jobid = this.selectedHost.requiresStorageMotion ? response.migratevirtualmachinewithvolumeresponse.jobid : response.migratevirtualmachineresponse.jobid
this.$store.dispatch('AddAsyncJob', {
title: `${this.$t('label.migrating')} ${this.resource.name}`,
jobid: response.migratevirtualmachineresponse.jobid,
jobid: jobid,
description: this.resource.name,
status: 'progress'
})
this.$pollJob({
jobId: response.migratevirtualmachineresponse.jobid,
jobId: jobid,
successMessage: `${this.$t('message.success.migrating')} ${this.resource.name}`,
successMethod: () => {
this.$parent.$parent.close()