From beeb34b00784f9398137cbc89a8978308e9b4019 Mon Sep 17 00:00:00 2001 From: davidjumani Date: Fri, 8 Jan 2021 17:42:19 +0530 Subject: [PATCH] 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 --- ui/src/views/compute/MigrateWizard.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/src/views/compute/MigrateWizard.vue b/ui/src/views/compute/MigrateWizard.vue index 4c558c1fbe2..87c4d638fe3 100644 --- a/ui/src/views/compute/MigrateWizard.vue +++ b/ui/src/views/compute/MigrateWizard.vue @@ -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()