This commit is contained in:
2022-05-29 23:17:52 -05:00
parent e50e7ef6e6
commit 142be715d6
8 changed files with 96 additions and 40 deletions
+5 -1
View File
@@ -112,7 +112,11 @@ export default {
activa: true
}
axios
.post(`${process.env.api}/Premiacion/nueva`, data)
.post(`${process.env.api}/Premiacion/nueva`, data, {
headers: {
token: localStorage.getItem('token'),
},
})
.then((res) => {
this.updateIsLoading(false)
this.success()
+11 -3
View File
@@ -77,7 +77,11 @@ export default {
fecha: this.fechaNueva,
}
axios
.put(`${process.env.api}/Premiacion/editar`, data)
.put(`${process.env.api}/Premiacion/editar`, data, {
headers: {
token: localStorage.getItem('token'),
},
})
.then((res) => {
this.updateIsLoading(false)
let message = 'Se ha editado la premiación con éxito.'
@@ -112,7 +116,11 @@ export default {
activa: !this.activa,
}
axios
.put(`${process.env.api}/Premiacion/activarDesactivar`, data)
.put(`${process.env.api}/Premiacion/activarDesactivar`, data, {
headers: {
token: localStorage.getItem('token'),
},
})
.then((res) => {
this.updateIsLoading(false)
let message =
@@ -175,7 +183,7 @@ export default {
confirmButtonColor: '#1e3c70',
}).then((res) => {
if (res.value) {
this.$router.push("/admin")
this.$router.push('/admin')
}
})
},
+5 -1
View File
@@ -108,7 +108,11 @@ export default {
password: this.password,
}
axios
.post(`${process.env.api}/usuario/nuevoOperador`, data)
.post(`${process.env.api}/usuario/nuevoOperador`, data, {
headers: {
token: localStorage.getItem('token'),
},
})
.then((res) => {
this.updateIsLoading(false)
this.success()
+12 -5
View File
@@ -1,7 +1,9 @@
<template>
<div>
<CrearPremiacion :updateIsLoading="updateIsLoading"/>
<h2 class="has-text-centered mt-5 is-size-3">Administración de premiaciones</h2>
<CrearPremiacion :updateIsLoading="updateIsLoading" />
<h2 class="has-text-centered mt-5 is-size-3">
Administración de premiaciones
</h2>
<TablaPremiaciones
:data="data"
:isLoadingTable="isLoadingTable"
@@ -20,14 +22,14 @@ import axios from 'axios'
export default {
components: {
TablaPremiaciones,
CrearPremiacion
CrearPremiacion,
},
props: {
updateIsLoading: {
type: Function,
required: true,
default: () => {},
}
},
},
data() {
return {
@@ -46,7 +48,12 @@ export default {
this.updateIsLoading(true)
axios
.get(
`${process.env.api}/premiacion/premiacionesPaginacion?pagina=${this.page}`
`${process.env.api}/premiacion/premiacionesPaginacion?pagina=${this.page}`,
{
headers: {
token: localStorage.getItem('token'),
},
}
)
.then((res) => {
if (res) {
+21 -8
View File
@@ -124,12 +124,16 @@ export default {
formData.append('file', this.csv)
axios
.post(`${process.env.api}/profesor/cargarDatos?idPremiacion=${this.idPremiacionCSV}`, formData, {
headers: {
'Content-Type': 'multipart/form-data',
// token: localStorage.getItem('token'),
},
})
.post(
`${process.env.api}/profesor/cargarDatos?idPremiacion=${this.idPremiacionCSV}`,
formData,
{
headers: {
'Content-Type': 'multipart/form-data',
token: localStorage.getItem('token'),
},
}
)
.then((res) => {
this.isLoading = false
this.csv = {}
@@ -199,7 +203,12 @@ export default {
this.isLoading = true
axios
.get(
`${process.env.api}/invitado/get?idPremiacion=${this.idPremiacion}`
`${process.env.api}/invitado/get?idPremiacion=${this.idPremiacion}`,
{
headers: {
token: localStorage.getItem('token'),
},
}
)
.then((res) => {
this.isLoading = false
@@ -223,7 +232,11 @@ export default {
async created() {
this.isLoading = true
await axios
.get(`${process.env.api}/premiacion/get`)
.get(`${process.env.api}/premiacion/get`, {
headers: {
token: localStorage.getItem('token'),
},
})
.then((res) => {
this.isLoading = false
if (res) {