diff --git a/resources/js/store/modules/pedido.js b/resources/js/store/modules/pedido.js index 5a878e6..5258142 100644 --- a/resources/js/store/modules/pedido.js +++ b/resources/js/store/modules/pedido.js @@ -34,12 +34,19 @@ const actions = { nombre: nombre, grupo_de_compra_id: grupo_de_compra_id }); - commit('setState', response.data); + const pedido = response.data; + await axios.post("/subpedidos/sesion", { id: pedido.id, }); + commit('setState', pedido); }, - async getPedido({ commit }, pedido_id) { - const response = await axios.get(`/api/subpedidos/${pedido_id}`); + 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, }); + window.location.href = 'productos'; + }, async modificarChismosa({ commit }, producto_id, cantidad, notas) {}, async modificarDevoluciones({ commit }, monto, notas) {} };