Fix #53
Some checks failed
Build and Push Docker Images / build-backend (push) Successful in 33s
Build and Push Docker Images / build-frontend (push) Has been cancelled

This commit is contained in:
2026-01-13 14:24:04 +01:00
parent 32b4c40e11
commit 267648074c
3 changed files with 15 additions and 9 deletions

View File

@@ -103,7 +103,8 @@ async function onSubmit(event: FormSubmitEvent<any>) {
start: startIso, // Die eingegebene Startzeit
end: endIso, // Die eingegebene Endzeit (oder null)
type: state.type,
description: state.description
description: state.description,
user_id: props.defaultUserId
})
toast.add({ title: 'Zeit manuell erfasst', color: 'green' })
@@ -131,6 +132,8 @@ async function onSubmit(event: FormSubmitEvent<any>) {
</div>
</template>
{{props}}
<UForm :schema="schema" :state="state" class="space-y-4" @submit="onSubmit">
<UFormGroup label="Typ" name="type">

View File

@@ -91,15 +91,18 @@ export const useStaffTime = () => {
}
// 🆕 NEU: Manuellen Eintrag erstellen (Vergangenheit oder Zeitraum)
const createEntry = async (data: { start: string, end: string | null, type: string, description: string }) => {
const createEntry = async (data: { start: string, end: string | null, type: string, description: string, user_id: string }) => {
// 1. Start Event senden
// Wir nutzen den dynamischen Typ (work_start, vacation_start etc.)
console.log(data)
await $api('/api/staff/time/event', {
method: 'POST',
body: {
eventtype: `${data.type}_start`,
eventtime: data.start,
payload: { description: data.description }
payload: { description: data.description },
user_id: data.user_id,
}
})
@@ -109,7 +112,9 @@ export const useStaffTime = () => {
method: 'POST',
body: {
eventtype: `${data.type}_end`,
eventtime: data.end
eventtime: data.end,
payload: { description: data.description },
user_id: data.user_id,
}
})
}