boton fin de semestre - falta el endpoint

This commit is contained in:
Andres2908 2022-07-26 14:51:33 -05:00
parent d1ac58b7ad
commit 2fa620250b
2 changed files with 50 additions and 0 deletions

View File

@ -153,6 +153,8 @@
Guardar
</b-button>
</b-field>
<BotonFinSemestre :updateIsLoading="updateIsLoading" :admin="admin" />
</div>
</div>
</div>
@ -160,8 +162,13 @@
<script>
import axios from 'axios'
import BotonFinSemestre from '@/components/botones/BotonFinSemestre'
export default {
components: {
BotonFinSemestre,
BotonFinSemestre,
},
props: {
buscar: { type: Function, required: true },
updateIsLoading: { type: Function, required: true },

View File

@ -0,0 +1,43 @@
<template>
<b-field>
<b-button
type="is-warning"
label="Desactivar cuentas"
@click="
$alertsGenericos.imprimirWarning(
$buefy,
'¿Estas segur@ de querer deshabilitar a todos los usuarios?',
desactivarCuentas
)
"
expanded
/>
</b-field>
</template>
<script>
export default {
props: {
updateIsLoading: { type: Function, required: true },
admin: { type: Object, required: true },
},
data() {
return {}
},
methods: {
desactivarCuentas() {
this.updateIsLoading(true)
axios
.put(`${process.env.api}/desactivar`, this.$getToken.token())
.then((res) => {
this.updateIsLoading(false)
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
})
.catch((err) => {
this.updateIsLoading(false)
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
})
},
},
}
</script>