Cambio de logica de obtener sesion + variable para habilitar devoluciones

This commit is contained in:
Alejandro Tasistro 2024-07-11 18:32:42 -03:00
parent 388beba5cc
commit 716d1ca6fa
1 changed files with 18 additions and 11 deletions

11
resources/js/app.js vendored
View File

@ -59,7 +59,8 @@ const app = new Vue({
data() {
return {
gdc: null,
pedido: null
pedido: null,
devoluciones: null,
}
},
computed: {
@ -77,12 +78,18 @@ const app = new Vue({
Event.$on('obtener-sesion', () => {
axios.get('/subpedidos/obtener_sesion')
.then(response => {
if (response.data.subpedido.id) {
this.pedido = response.data.subpedido.id
axios.get('/api/subpedidos/' + this.pedido)
.then(response => {
this.pedido = response.data.data
this.gdc = this.pedido.grupo_de_compra.id
})
} else {
axios.get('/admin/obtener_sesion')
.then(response => {
this.gdc = response.data.gdc
})
}
})
})
Event.$on('sync-subpedido', (cantidad, id) => {