From 36af26a647737dacedd399d2a96bb71dfbe6f846 Mon Sep 17 00:00:00 2001 From: ale Date: Wed, 21 May 2025 22:40:53 -0300 Subject: [PATCH] Agregada logica de sesion --- resources/js/store/modules/pedido.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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) {} };