add MaterialDeleteDialog
This commit is contained in:
@ -100,8 +100,8 @@ export const store = new Vuex.Store({
|
||||
return []
|
||||
},
|
||||
|
||||
selectedMaterial: (state, getters) => (id) => {
|
||||
return getters.material(id)
|
||||
selectedMaterial: (state, getters) => {
|
||||
return getters.material(state.selectedMaterialID)
|
||||
},
|
||||
|
||||
/// OLD STUFF
|
||||
@ -494,6 +494,16 @@ export const store = new Vuex.Store({
|
||||
// let { data } = await Axios.post('http://yourwebsite.com/api/todo')
|
||||
// context.commit('ADD_TODO',payload)
|
||||
// },
|
||||
deleteModelMaterial({ commit, getters }, { section, model, material }) {
|
||||
let mats = model.ids.filter(id => id !== material.id)
|
||||
|
||||
commit('setModelMaterials', { model: model, materials: mats })
|
||||
|
||||
// repaginate section
|
||||
let models = getters.sectionModels(section)
|
||||
let pages = paginateModels(models)
|
||||
commit('setSectionPages', { section: section, pages: pages })
|
||||
},
|
||||
|
||||
setCatalogProperty(context, data) {
|
||||
context.commit('setCatalogProperty', data)
|
||||
|
||||
Reference in New Issue
Block a user