compute: Back to list VM when deleting VM with the Expunge option. (#755)

* compute: back to list VM when deleting VM with the Expunge option.

* fixes: go back if is a detail view

* fix go back only vm detail view

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Hoang Nguyen 2020-09-28 17:49:17 +07:00 committed by Rohit Yadav
parent fab2a93775
commit 75bacaf8c9
1 changed files with 8 additions and 2 deletions

View File

@ -134,9 +134,15 @@ export default {
jobId,
loadingMessage: `${this.$t('message.deleting.vm')} ${this.resource.name}`,
catchMessage: this.$t('error.fetching.async.job.result'),
successMessage: `${this.$t('message.success.delete.vm')} ${this.resource.name}`
successMessage: `${this.$t('message.success.delete.vm')} ${this.resource.name}`,
successMethod: () => {
if (this.$route.path.includes('/vm/') && values.expunge) {
this.$router.go(-1)
} else {
this.parentFetchData()
}
}
})
this.parentFetchData()
this.closeAction()
}).catch(error => {
this.$notifyError(error)