forked from nathalie/pedi2
Cambio de logica de obtener sesion + variable para habilitar devoluciones
This commit is contained in:
parent
388beba5cc
commit
716d1ca6fa
|
@ -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 => {
|
||||
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
|
||||
})
|
||||
if (response.data.subpedido.id) {
|
||||
this.pedido = response.data.subpedido.id
|
||||
axios.get('/api/subpedidos/' + this.pedido)
|
||||
.then(response => {
|
||||
this.pedido = response.data.data
|
||||
})
|
||||
} else {
|
||||
axios.get('/admin/obtener_sesion')
|
||||
.then(response => {
|
||||
this.gdc = response.data.gdc
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
Event.$on('sync-subpedido', (cantidad, id) => {
|
||||
|
|
Loading…
Reference in New Issue