boton fin de semestre - falta el endpoint
This commit is contained in:
parent
d1ac58b7ad
commit
2fa620250b
@ -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 },
|
||||
|
43
components/botones/BotonFinSemestre.vue
Normal file
43
components/botones/BotonFinSemestre.vue
Normal 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>
|
Loading…
Reference in New Issue
Block a user