Agregados toast
This commit is contained in:
parent
f837b7f066
commit
5b9908e0b5
2 changed files with 6 additions and 1 deletions
5
resources/js/store/modules/admin.js
vendored
5
resources/js/store/modules/admin.js
vendored
|
@ -38,9 +38,12 @@ const actions = {
|
|||
const response = await axios.get('/user/grupo_de_compra');
|
||||
commit('setState', response.data);
|
||||
},
|
||||
async setAprobacionPedido({ commit }, { pedido_id, aprobacion }){
|
||||
async setAprobacionPedido({ commit, dispatch }, { pedido_id, aprobacion }){
|
||||
await axios.post("/api/admin/subpedidos/" + pedido_id + "/aprobacion", { aprobacion: aprobacion });
|
||||
await actions.getGrupoDeCompra({ commit });
|
||||
dispatch("ui/toast",
|
||||
{ mensaje: `Pedido ${aprobacion ? '' : 'des' }aprobado con éxito.` },
|
||||
{ root: true });
|
||||
},
|
||||
async toggleCaracteristica({ commit }, { caracteristica_id }) {
|
||||
await axios.post(`/api/grupos-de-compra/${state.grupo_de_compra_id}/${caracteristica_id}`);
|
||||
|
|
2
resources/js/store/modules/pedido.js
vendored
2
resources/js/store/modules/pedido.js
vendored
|
@ -50,6 +50,7 @@ const actions = {
|
|||
notas: notas,
|
||||
});
|
||||
commit('setState', response.data.data);
|
||||
dispatch("ui/toast", { mensaje: 'Pedido modificado con éxito' }, { root: true });
|
||||
} catch (error) {
|
||||
dispatch("ui/error", { error: error }, { root: true });
|
||||
}
|
||||
|
@ -61,6 +62,7 @@ const actions = {
|
|||
notas: notas,
|
||||
});
|
||||
commit('setState', response.data.data);
|
||||
dispatch("ui/toast", { mensaje: 'Devoluciones modificadas con éxito' }, { root: true });
|
||||
} catch (error) {
|
||||
dispatch("ui/error", { error: error }, { root: true });
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue