feat: enable password update
Deploy Miniplan / build (push) Successful in 2m21s

This commit is contained in:
2025-03-22 07:56:51 +01:00
parent e4de1c62f8
commit 9eecde7a80
4 changed files with 93 additions and 4 deletions
@@ -7,6 +7,7 @@ import {ref, toRaw} from "vue";
import {onKeyPress} from "@/composables/enter";
import {API} from "@/services/api";
import {Dialogs} from "@/services/DialogService";
import UpdatePasswordDialog from "@/components/dialog/UpdatePasswordDialog.vue";
interface CreateMinistrantDialogProps extends DialogControls {
onCreate: (any) => (Promise<any> | undefined),
onDelete: (id) => (Promise<any> | undefined),
@@ -62,6 +63,23 @@ async function resetPassword(username: string) {
console.log(result)
}
async function updatePassword(username: string) {
Dialogs.createDialog(
UpdatePasswordDialog,
{
onDismiss(){},
onNegative(){},
onPositive(){},
},
{
async onUpdated(newPassword: string){
await API.updatePassword(username, newPassword)
},
username
}
)
}
</script>
<template>
@@ -75,7 +93,9 @@ async function resetPassword(username: string) {
<Input class="input" v-model:value="ministrant.privileges" label="Privilegien"/>
<div class="actions" v-if="ministrant.id != -1">
<button @click="resetPassword(ministrant.username)"><i>lock_reset</i>Passwort zurücksetzen
<!-- <button @click="resetPassword(ministrant.username)"><i>lock_reset</i>Passwort zurücksetzen-->
<!-- </button>-->
<button @click="updatePassword(ministrant.username)"><i>lock_reset</i>Passwort ändern
</button>
<button class="red" @click="deleteMinistrant()"><i>delete</i>Entfernen</button>
</div>