CatalogEditor: redirect on successful save
This commit is contained in:
@ -54,6 +54,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import Loading from './Loading'
|
||||
import CatalogInfo from './CatalogInfo'
|
||||
import CatalogContents from './CatalogContents'
|
||||
@ -80,6 +81,9 @@ export default {
|
||||
savingCatalog() {
|
||||
return this.$store.getters.savingCatalog
|
||||
},
|
||||
...mapState([
|
||||
'catalogSavedOK',
|
||||
]),
|
||||
},
|
||||
methods: {
|
||||
popExit: function(id) {
|
||||
@ -89,6 +93,14 @@ export default {
|
||||
this.$store.dispatch('saveCatalog')
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
catalogSavedOK(value) {
|
||||
if (value) {
|
||||
console.log('catalog saved. redirecting to catalog list...')
|
||||
window.location.href = '/catalogs'
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
// catalogID is set by django
|
||||
// in a script block in our parent page.
|
||||
|
||||
Reference in New Issue
Block a user