From 09bc8e7670e49d660f880e29e0574f1f7f502ce7 Mon Sep 17 00:00:00 2001 From: ale Date: Sun, 18 May 2025 22:44:25 -0300 Subject: [PATCH] Cambio logica --- resources/js/app.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/resources/js/app.js b/resources/js/app.js index fd19e5b..aadb9e8 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -82,9 +82,14 @@ const app = new Vue({ }, mounted() { Event.$on('obtener-sesion', () => { - axios.get('/subpedidos/obtener_sesion') - .then(response => { - if (response.data.subpedido.id) { + if (window.location.pathname.startsWith('/admin')) { + axios.get('/admin/obtener_sesion') + .then(response => { + this.gdc = response.data.gdc + }); + } else { + axios.get('/subpedidos/obtener_sesion') + .then(response => { this.gdc = response.data.gdc; this.settearDevoluciones(); this.pedido = response.data.subpedido.id; @@ -93,13 +98,8 @@ const app = new Vue({ this.pedido = response.data.data; Event.$emit("pedido-actualizado"); }); - } else { - axios.get('/admin/obtener_sesion') - .then(response => { - this.gdc = response.data.gdc - }); - } - }) + }) + } }) Event.$on('sync-subpedido', (cantidad, id, notas) => { if (this.pedido.aprobado) {