Fix #53
This commit is contained in:
@@ -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">
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user