CatalogEditor: redirect on successful save

This commit is contained in:
Seth Ladygo
2019-05-20 04:16:16 -07:00
parent dec83dc010
commit ef92dd5c96
2 changed files with 22 additions and 9 deletions

View File

@ -19,6 +19,7 @@ export const store = new Vuex.Store({
selectedMaterialID: null,
loadingCatalog: false,
savingCatalog: false,
catalogSavedOK: false,
loadingProducts: false,
},
getters: {
@ -96,10 +97,6 @@ export const store = new Vuex.Store({
return state.catalog[key]
},
//
// selection info
//
loadingCatalog(state) {
return state.loadingCatalog
},
@ -195,6 +192,10 @@ export const store = new Vuex.Store({
}
},
setCatalogProperty(state, { key, value }) {
state.catalog[key] = value
},
setLoadingCatalog(state, value) {
state.loadingCatalog = value
},
@ -203,12 +204,12 @@ export const store = new Vuex.Store({
state.savingCatalog = value
},
setLoadingProducts(state, value) {
state.loadingProducts = value
setCatalogSavedOK(state, value) {
state.catalogSavedOK = value
},
setCatalogProperty(state, { key, value }) {
state.catalog[key] = value
setLoadingProducts(state, value) {
state.loadingProducts = value
},
},
@ -470,9 +471,9 @@ export const store = new Vuex.Store({
if (response.data) {
console.log('recieved catalog:', response.data)
commit('setCatalog', response.data)
commit('setCatalogSavedOK', true)
} else {
console.error('no catalog returned from save!')
commit('newCatalog')
}
commit('setSavingCatalog', false)
})