API integration stuff

This commit is contained in:
2025-08-25 23:34:49 -04:00
parent 3dadaf3b24
commit 342c6cd706
4 changed files with 100 additions and 23 deletions

View File

@@ -16,6 +16,7 @@ import { Form } from 'vee-validate';
import { onMounted, ref } from 'vue';
import * as z from 'zod';
import DateInput from '../form/DateInput.vue';
import { ApplicationData } from '@/api/application';
const formSchema = toTypedSchema(z.object({
dob: z.string().refine(v => v, { message: "A date of birth is required." }),
@@ -45,7 +46,7 @@ const fallbackInitials = {
const props = defineProps<{
readOnly: boolean,
data: object,
data: ApplicationData,
}>()
const emit = defineEmits(['submit']);
@@ -57,8 +58,8 @@ async function onSubmit(val: any) {
}
onMounted(() => {
if (props.data) {
initialValues.value = { ...props.data, ...fallbackInitials }
if (props.data !== null) {
initialValues.value = { ...props.data }
} else {
initialValues.value = { ...fallbackInitials }
}