Redirección movida a vuex

This commit is contained in:
Alejandro Tasistro 2025-05-21 22:40:23 -03:00
parent 8fbfa75144
commit cdf5663b16

View file

@ -55,14 +55,13 @@ export default {
},
methods: {
...mapActions('barrio',["getGrupoDeCompra","getPedidos"]),
...mapActions('pedido',["crearPedido"]),
...mapActions('pedido',["crearPedido","elegirPedido"]),
...mapMutations('barrio',["setPedidos"]),
onType() {
if (!this.searchString) {
this.setPedidos([]);
return;
}
this.getPedidos(this.searchString);
},
async submit() {
@ -74,13 +73,14 @@ export default {
this.guardarSubpedidoEnSesion(subpedido);
},
guardarSubpedidoEnSesion(subpedido) {
console.log(`select: ${JSON.stringify(subpedido)}`);
axios.post("/subpedidos/guardar_sesion", {
subpedido: subpedido,
grupo_de_compra_id: this.grupo_de_compra_id
}).then(_ => {
Event.$emit('obtener-sesion')
window.location.href = 'productos';
});
this.elegirPedido({ pedido: subpedido });
}
}
}