autogen: Fix page navigation error when delete template. (#599)

* Fix page navigation error when delete template.

* removed double `!` syntax

Fixes #598

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Hoang Nguyen 2020-08-20 16:52:20 +07:00 committed by Rohit Yadav
parent 2bc239fa76
commit 5cc1d732d4
2 changed files with 8 additions and 1 deletions

View File

@ -606,6 +606,10 @@ export default {
if (this.items.length > 0) {
this.resource = this.items[0]
this.$emit('change-resource', this.resource)
} else {
if (this.dataView) {
this.$router.push({ path: '/exception/404' })
}
}
}).catch(error => {
if (Object.keys(this.searchParams).length > 0) {

View File

@ -266,7 +266,10 @@ export default {
jobId,
successMethod: result => {
if (singleZone) {
this.$router.go(-1)
const isResourcePage = (this.$route.params && this.$route.params.id)
if (isResourcePage) {
this.$router.go(-1)
}
} else {
this.fetchData()
}