Cambio logica
This commit is contained in:
parent
8a1334bae5
commit
09bc8e7670
1 changed files with 10 additions and 10 deletions
20
resources/js/app.js
vendored
20
resources/js/app.js
vendored
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue