BETA for new DB

This commit is contained in:
2025-12-08 14:40:21 +01:00
parent 9bfb880f7b
commit 888336dd04
8 changed files with 256 additions and 68 deletions

View File

@@ -10,6 +10,7 @@ interface StaffTimeEntry {
export function useStaffTime() {
const { $api } = useNuxtApp()
const auth = useAuthStore()
@@ -46,9 +47,17 @@ export function useStaffTime() {
}
async function approve(id: string) {
return await $api<StaffTimeEntry>(`/api/staff/time/${id}`, {
const auth = useAuthStore()
const now = useNuxtApp().$dayjs().toISOString()
return await $api(`/api/staff/time/${id}`, {
method: 'PUT',
body: { state: 'approved' },
body: {
state: 'approved',
//@ts-ignore
approved_by: auth.user.id,
approved_at: now,
},
})
}