Simplificado seleccionarCategoria
This commit is contained in:
parent
b76ecf57dc
commit
caebf1b53b
1 changed files with 2 additions and 4 deletions
6
resources/js/store/modules/productos.js
vendored
6
resources/js/store/modules/productos.js
vendored
|
@ -36,10 +36,8 @@ const actions = {
|
|||
commit('setFiltro', null);
|
||||
commit('setProductos', response.data.data);
|
||||
},
|
||||
async seleccionarCategoria({ commit }, { categoria }) {
|
||||
const response = await axios.get("/api/productos");
|
||||
commit('setFiltro', { clave: "categoria", valor: categoria });
|
||||
commit('setProductos', response.data.data);
|
||||
async seleccionarCategoria({ dispatch }, { categoria }) {
|
||||
dispatch('filtrarProductos', { filtro: "categoria", valor: categoria });
|
||||
},
|
||||
async filtrarProductos({ commit }, { filtro, valor }) {
|
||||
const response = await axios.get("/api/productos", {
|
||||
|
|
Loading…
Add table
Reference in a new issue