2022-07-26 19:51:33 +00:00
|
|
|
<template>
|
|
|
|
<b-field>
|
|
|
|
<b-button
|
|
|
|
type="is-warning"
|
|
|
|
label="Desactivar cuentas"
|
|
|
|
@click="
|
|
|
|
$alertsGenericos.imprimirWarning(
|
|
|
|
$buefy,
|
2023-01-08 23:50:17 +00:00
|
|
|
'¿Estas segur@ de querer deshabilitar las cuentas de todos los usuarios?',
|
2022-07-26 19:51:33 +00:00
|
|
|
desactivarCuentas
|
|
|
|
)
|
|
|
|
"
|
|
|
|
expanded
|
|
|
|
/>
|
|
|
|
</b-field>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2023-01-08 23:50:17 +00:00
|
|
|
import axios from 'axios'
|
|
|
|
|
2022-07-26 19:51:33 +00:00
|
|
|
export default {
|
|
|
|
props: {
|
2022-08-14 22:23:01 +00:00
|
|
|
updateIsLoading: { type: Function, required: true, default: () => {} },
|
|
|
|
admin: { type: Object, required: true, default: () => ({}) },
|
2022-07-26 19:51:33 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
desactivarCuentas() {
|
|
|
|
this.updateIsLoading(true)
|
2022-12-05 15:36:30 +00:00
|
|
|
return axios
|
2023-01-08 23:50:17 +00:00
|
|
|
.put(
|
|
|
|
`${process.env.api}/institucion-usuario/desactivar-cuentas`,
|
|
|
|
{},
|
|
|
|
this.$getToken.token()
|
|
|
|
)
|
2022-07-26 19:51:33 +00:00
|
|
|
.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
|
|
|
|
)
|
2022-07-26 19:51:33 +00:00
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|