perbaikan created_at timesheet
This commit is contained in:
@@ -160,6 +160,7 @@
|
||||
total_work_hour: 0,
|
||||
remarks: "",
|
||||
approval: null, // Default null
|
||||
created_at: new Date().toISOString(),
|
||||
};
|
||||
// Fetch initial data on mount
|
||||
onMount(async () => {
|
||||
@@ -624,6 +625,21 @@
|
||||
|
||||
error = updateError;
|
||||
} else {
|
||||
form = {
|
||||
...form,
|
||||
entered_by: form.entered_by,
|
||||
work_description: form.work_description,
|
||||
type_of_work: form.type_of_work,
|
||||
category_of_work: form.category_of_work,
|
||||
villa_id: form.villa_id,
|
||||
datetime_in: form.datetime_in,
|
||||
datetime_out: form.datetime_out,
|
||||
total_work_hour: form.total_work_hour,
|
||||
remarks: form.remarks,
|
||||
approval: form.approval || null, // Allow null for new entries
|
||||
created_at: new Date().toISOString(),
|
||||
};
|
||||
|
||||
const { error: insertError } = await supabase
|
||||
.from("vb_timesheet")
|
||||
.insert([form]);
|
||||
|
||||
Reference in New Issue
Block a user