BETA for new DB
This commit is contained in:
@@ -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,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user