diff --git a/components/admin/restarCredito.vue b/components/admin/restarCredito.vue index 9da6652..f97d639 100644 --- a/components/admin/restarCredito.vue +++ b/components/admin/restarCredito.vue @@ -35,6 +35,8 @@ export default { }, data() { return { + token: '', + numeroCuenta: '', credito: '', datos: {}, @@ -45,7 +47,8 @@ export default { this.updateIsLoading(true) axios .get( - `${process.env.api}/usuario/credito?numeroCuenta=${this.numeroCuenta}` + `${process.env.api}/admin/credito?numeroCuenta=${this.numeroCuenta}`, + this.token ) .then((res) => { this.updateIsLoading(false) @@ -65,7 +68,7 @@ export default { } this.updateIsLoading(true) axios - .get(`${process.env.api}/usuario/restar_credito`, data) + .get(`${process.env.api}/usuario/restar_credito`, data, this.token) .then((res) => { this.updateIsLoading(false) ;(this.datos.nombre = res.data.nombre), @@ -79,6 +82,11 @@ export default { }) }, }, + created() { + this.token = { + headers: { token: localStorage.getItem('token') }, + } + }, } diff --git a/components/impresion/datosTicket.vue b/components/impresion/datosTicket.vue index fc56a33..e10e04a 100644 --- a/components/impresion/datosTicket.vue +++ b/components/impresion/datosTicket.vue @@ -38,7 +38,7 @@
Tu crédito es de: $0 pesos
+Tu crédito es de: ${{ creditoDisponible }} pesos