Redirección movida a vuex
This commit is contained in:
parent
8fbfa75144
commit
cdf5663b16
1 changed files with 3 additions and 3 deletions
|
@ -55,14 +55,13 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions('barrio',["getGrupoDeCompra","getPedidos"]),
|
...mapActions('barrio',["getGrupoDeCompra","getPedidos"]),
|
||||||
...mapActions('pedido',["crearPedido"]),
|
...mapActions('pedido',["crearPedido","elegirPedido"]),
|
||||||
...mapMutations('barrio',["setPedidos"]),
|
...mapMutations('barrio',["setPedidos"]),
|
||||||
onType() {
|
onType() {
|
||||||
if (!this.searchString) {
|
if (!this.searchString) {
|
||||||
this.setPedidos([]);
|
this.setPedidos([]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.getPedidos(this.searchString);
|
this.getPedidos(this.searchString);
|
||||||
},
|
},
|
||||||
async submit() {
|
async submit() {
|
||||||
|
@ -74,13 +73,14 @@ export default {
|
||||||
this.guardarSubpedidoEnSesion(subpedido);
|
this.guardarSubpedidoEnSesion(subpedido);
|
||||||
},
|
},
|
||||||
guardarSubpedidoEnSesion(subpedido) {
|
guardarSubpedidoEnSesion(subpedido) {
|
||||||
|
console.log(`select: ${JSON.stringify(subpedido)}`);
|
||||||
axios.post("/subpedidos/guardar_sesion", {
|
axios.post("/subpedidos/guardar_sesion", {
|
||||||
subpedido: subpedido,
|
subpedido: subpedido,
|
||||||
grupo_de_compra_id: this.grupo_de_compra_id
|
grupo_de_compra_id: this.grupo_de_compra_id
|
||||||
}).then(_ => {
|
}).then(_ => {
|
||||||
Event.$emit('obtener-sesion')
|
Event.$emit('obtener-sesion')
|
||||||
window.location.href = 'productos';
|
|
||||||
});
|
});
|
||||||
|
this.elegirPedido({ pedido: subpedido });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue