51 lines
1.2 KiB
Vue
51 lines
1.2 KiB
Vue
<template>
|
|
<b-field>
|
|
<b-button
|
|
type="is-warning"
|
|
label="Desactivar cuentas"
|
|
@click="
|
|
$alertsGenericos.imprimirWarning(
|
|
$buefy,
|
|
'¿Estas segur@ de querer deshabilitar las cuentas de todos los usuarios?',
|
|
desactivarCuentas
|
|
)
|
|
"
|
|
expanded
|
|
/>
|
|
</b-field>
|
|
</template>
|
|
|
|
<script>
|
|
import axios from 'axios'
|
|
|
|
export default {
|
|
props: {
|
|
updateIsLoading: { type: Function, required: true, default: () => {} },
|
|
admin: { type: Object, required: true, default: () => ({}) },
|
|
},
|
|
methods: {
|
|
desactivarCuentas() {
|
|
this.updateIsLoading(true)
|
|
return axios
|
|
.put(
|
|
`${process.env.api}/institucion-usuario/desactivar-cuentas`,
|
|
{},
|
|
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,
|
|
this.$router,
|
|
err.response.data
|
|
)
|
|
})
|
|
},
|
|
},
|
|
}
|
|
</script>
|