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() {
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) {