Cambio logica

This commit is contained in:
Alejandro Tasistro 2025-05-18 22:44:25 -03:00
parent 8a1334bae5
commit 09bc8e7670

20
resources/js/app.js vendored
View file

@ -82,9 +82,14 @@ const app = new Vue({
}, },
mounted() { mounted() {
Event.$on('obtener-sesion', () => { Event.$on('obtener-sesion', () => {
axios.get('/subpedidos/obtener_sesion') if (window.location.pathname.startsWith('/admin')) {
.then(response => { axios.get('/admin/obtener_sesion')
if (response.data.subpedido.id) { .then(response => {
this.gdc = response.data.gdc
});
} else {
axios.get('/subpedidos/obtener_sesion')
.then(response => {
this.gdc = response.data.gdc; this.gdc = response.data.gdc;
this.settearDevoluciones(); this.settearDevoluciones();
this.pedido = response.data.subpedido.id; this.pedido = response.data.subpedido.id;
@ -93,13 +98,8 @@ const app = new Vue({
this.pedido = response.data.data; this.pedido = response.data.data;
Event.$emit("pedido-actualizado"); Event.$emit("pedido-actualizado");
}); });
} else { })
axios.get('/admin/obtener_sesion') }
.then(response => {
this.gdc = response.data.gdc
});
}
})
}) })
Event.$on('sync-subpedido', (cantidad, id, notas) => { Event.$on('sync-subpedido', (cantidad, id, notas) => {
if (this.pedido.aprobado) { if (this.pedido.aprobado) {