pcpuma_unam_operador/components/admin/Dias.vue

53 lines
1.1 KiB
Vue
Raw Normal View History

2022-07-26 16:49:26 +00:00
<template>
<TablaDias
:dias="dias"
:isLoadingTable="isLoadingTable"
:obtenerDias="obtenerDias"
:updateIsLoading="updateIsLoading"
/>
</template>
<script>
import axios from 'axios'
2022-08-05 12:45:31 +00:00
import TablaDias from '@/components/tablas/TablaDias'
2022-07-26 16:49:26 +00:00
export default {
components: { TablaDias },
props: {
updateIsLoading: { type: Function, required: true },
idInstitucion: { type: Number, required: true, default: false },
},
data() {
return {
dias: [],
isLoadingTable: false,
}
},
methods: {
obtenerDias() {
this.isLoadingTable = true
2022-12-05 15:36:30 +00:00
return axios
2022-07-26 16:49:26 +00:00
.get(
`${process.env.api}/institucion-dia?id_institucion=${this.idInstitucion}`,
this.$getToken.token()
)
.then((res) => {
this.dias = res.data
this.isLoadingTable = false
})
.catch((err) => {
this.isLoadingTable = false
2022-08-05 23:41:37 +00:00
this.$alertsGenericos.imprimirError(
this.$buefy,
this.$router,
err.response.data
)
2022-07-26 16:49:26 +00:00
})
},
},
created() {
this.obtenerDias()
},
}
</script>