feat: add delete button to gottesdienst edit dialog

This commit is contained in:
2026-07-14 22:16:58 +02:00
parent 924b443bdc
commit 3beb92c300
2 changed files with 10 additions and 5 deletions
@@ -9,7 +9,8 @@ import {onKeyPress} from "@/composables/enter";
interface CreateGottesdienstDialogProps extends DialogControls {
onCreate: (arg0: Gottesdienst) => (Promise<any> | undefined),
gottesdienst?: Gottesdienst,
planId: number
planId: number,
onDelete?: () => void
}
onKeyPress("Enter", create)
@@ -70,9 +71,12 @@ async function create(){
<Input class="input" v-model:value="date" date-format="string" type="date" label="Datum"/>
<Input class="input" v-model:value="time" date-format="string" type="time" label="Um"/>
<Input class="input" v-model:value="godi.attendance" type="time" label="Anwesenheit"/>
<div class="buttons" style="display: flex; justify-content: end; margin-top: 20px;">
<button @click="onDismiss">Abbrechen</button>
<button @click="create">{{ godi?.id == -1 ? "Erstellen" : "Speichern"}}</button>
<div class="buttons" style="display: flex; justify-content: space-between; margin-top: 20px;">
<button v-if="godi.id != -1 && onDelete" class="red" @click="onDelete(); onDismiss()"><i class="icon">delete</i> Löschen</button>
<div style="display: flex; gap: 8px; margin-left: auto;">
<button @click="onDismiss">Abbrechen</button>
<button @click="create">{{ godi?.id == -1 ? "Erstellen" : "Speichern"}}</button>
</div>
</div>
</Dialog>
+2 -1
View File
@@ -128,7 +128,8 @@ async function createGottesdienst(gottesdienstId?: number){
plan.gottesdienste.splice(index, 1)
plan.gottesdienste.push(godi)
}
}
},
onDelete: gottesdienst ? () => deleteGottedienst(gottesdienst.id) : undefined
})
}