pcpuma_unam_operador/components/tablas/UpdatePassword.vue

69 lines
1.4 KiB
Vue
Raw Normal View History

2022-06-07 18:50:55 +00:00
<template>
<div class="columns is-vcentered">
<div class="column">
<b-button
type="is-info"
@click="
2022-07-11 14:15:10 +00:00
$alertsGenericos.imprimirWarning(
$buefy,
'¿Esta segur@ de querer reenviar la contraseña de este operador?',
2022-06-07 18:50:55 +00:00
updatePassword
)
"
expanded
rounded
>
Reenviar Contraseña
2022-06-07 18:50:55 +00:00
</b-button>
</div>
2022-08-29 02:56:55 +00:00
<b-loading :can-cancel="false" v-model="isLoading" is-full-page />
2022-06-07 18:50:55 +00:00
</div>
</template>
<script>
import axios from 'axios'
export default {
data() {
return {
isLoading: false,
}
},
props: {
admin: { type: Object, required: true },
updateIsLoading: { type: Function, required: true },
operador: { type: Object, required: true },
},
methods: {
updatePassword() {
const data = {
id_operador: this.operador.id_operador,
2022-06-07 18:50:55 +00:00
}
this.isLoading = true
2022-12-05 15:36:30 +00:00
return axios
.put(
`${process.env.api}/operador/update-password`,
data,
2022-07-19 16:41:33 +00:00
this.$getToken.token()
)
.then((res) => {
this.isLoading = false
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
})
.catch((err) => {
this.isLoading = false
2022-08-05 23:41:37 +00:00
this.$alertsGenericos.imprimirError(
this.$buefy,
this.$router,
err.response.data
)
})
2022-06-07 18:50:55 +00:00
},
},
}
</script>
<style></style>