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() {
|
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) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue