pcpuma_unam_operador/components/botones/BotonFinSemestre.vue

48 lines
1.1 KiB
Vue
Raw Normal View History

<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: {
2022-08-14 22:23:01 +00:00
updateIsLoading: { type: Function, required: true, default: () => {} },
admin: { type: Object, required: true, default: () => ({}) },
},
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)
2022-08-05 23:41:37 +00:00
this.$alertsGenericos.imprimirError(
this.$buefy,
this.$router,
err.response.data
)
})
},
},
}
</script>