This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user