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('setFiltro', null);
|
||||||
commit('setProductos', response.data.data);
|
commit('setProductos', response.data.data);
|
||||||
},
|
},
|
||||||
async seleccionarCategoria({ commit }, { categoria }) {
|
async seleccionarCategoria({ dispatch }, { categoria }) {
|
||||||
const response = await axios.get("/api/productos");
|
dispatch('filtrarProductos', { filtro: "categoria", valor: categoria });
|
||||||
commit('setFiltro', { clave: "categoria", valor: categoria });
|
|
||||||
commit('setProductos', response.data.data);
|
|
||||||
},
|
},
|
||||||
async filtrarProductos({ commit }, { filtro, valor }) {
|
async filtrarProductos({ commit }, { filtro, valor }) {
|
||||||
const response = await axios.get("/api/productos", {
|
const response = await axios.get("/api/productos", {
|
||||||
|
|
Loading…
Add table
Reference in a new issue