Crear pedido setea state, quitado todo lo relativo a sesion, y quitado codigo comentado

This commit is contained in:
Alejandro Tasistro 2025-05-22 21:46:06 -03:00
parent a594e8a049
commit 94e384c83c
2 changed files with 0 additions and 26 deletions

17
resources/js/app.js vendored
View file

@ -71,21 +71,6 @@ const app = new Vue({
}
},
mounted() {
Event.$on('obtener-sesion', () => {
if (!window.location.pathname.startsWith('/admin')) {
axios.get('/subpedidos/obtener_sesion')
.then(response => {
this.gdc = response.data.gdc;
// this.settearDevoluciones();
this.pedido = response.data.subpedido.id;
axios.get('/api/subpedidos/' + this.pedido)
.then(response => {
this.pedido = response.data.data;
Event.$emit("pedido-actualizado");
});
})
}
})
Event.$on('sync-subpedido', (cantidad, id, notas) => {
if (this.pedido.aprobado) {
this.$toast('No se puede modificar un pedido ya aprobado', 2000);
@ -117,8 +102,6 @@ const app = new Vue({
Event.$emit("pedido-actualizado");
});
});
if (window.location.pathname.startsWith('/productos'))
Event.$emit('obtener-sesion')
},
});

View file

@ -34,20 +34,11 @@ const actions = {
nombre: nombre,
grupo_de_compra_id: grupo_de_compra_id
});
const pedido = response.data;
await axios.post("/subpedidos/sesion", { id: pedido.id, });
commit('setState', pedido);
},
async getPedido({ commit }) {
const sesion = await axios.get("/subpedidos/sesion");
const response = await axios.get(`/api/subpedidos/${sesion.data}`);
commit('setState', response.data.data);
},
async elegirPedido({ commit }, { pedido }) {
await axios.post("/subpedidos/sesion", { id: pedido.id, });
const response = await axios.get(`/api/subpedidos/${pedido.id}`);
commit('setState', response.data.data);
// window.location.href = 'productos';
},
async modificarChismosa({ commit }, producto_id, cantidad, notas) {},
async modificarDevoluciones({ commit }, monto, notas) {}