fixed checbox not reporting correct value

This commit is contained in:
2025-11-19 14:44:16 -05:00
parent 7850767967
commit aacb499971

View File

@@ -31,10 +31,10 @@ const { handleSubmit, resetForm, errors } = useForm({
const submitForm = handleSubmit(onSubmit); const submitForm = handleSubmit(onSubmit);
function toMySQLDateTime(date: Date): string { function toMySQLDateTime(date: Date): string {
return date return date
.toISOString() // 2025-11-19T00:00:00.000Z .toISOString() // 2025-11-19T00:00:00.000Z
.slice(0, 23) // keep milliseconds → 2025-11-19T00:00:00.000 .slice(0, 23) // keep milliseconds → 2025-11-19T00:00:00.000
.replace("T", " ") + "000"; // becomes → 2025-11-19 00:00:00.000000 .replace("T", " ") + "000"; // becomes → 2025-11-19 00:00:00.000000
} }
@@ -48,7 +48,7 @@ function onSubmit(vals) {
postTrainingReport(clean); postTrainingReport(clean);
console.log("SUBMITTED:", clean) console.log("SUBMITTED:", clean)
} catch(err) { } catch (err) {
console.log("There was an error submitting the training report", err); console.log("There was an error submitting the training report", err);
} }
} }
@@ -145,7 +145,7 @@ onMounted(async () => {
<!-- Passed Checkbox --> <!-- Passed Checkbox -->
<VeeField :name="`attendees[${index}].passed`" v-slot="{ field: f, errors: e }"> <VeeField :name="`attendees[${index}].passed`" v-slot="{ field: f, errors: e }">
<div class="flex items-center h-[38px]"> <div class="flex items-center h-[38px]">
<input type="checkbox" class="h-4 w-4" v-bind="f" /> <input type="checkbox" :checked="f.value" @change="f.onChange($event)" />
</div> </div>
</VeeField> </VeeField>