Agregados toast

This commit is contained in:
Alejandro Tasistro 2025-05-23 02:18:12 -03:00
parent f837b7f066
commit 5b9908e0b5
2 changed files with 6 additions and 1 deletions

View file

@ -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}`);

View file

@ -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 });
}