types fixed

This commit is contained in:
2025-08-10 23:42:44 +05:30
parent 4b1ee273e4
commit 9cdb40e395

View File

@@ -121,6 +121,7 @@ export function AppointmentForm({
// Format the date and times for the form // Format the date and times for the form
const defaultValues: Partial<Appointment> = appointment const defaultValues: Partial<Appointment> = appointment
? { ? {
userId: user?.id,
patientId: appointment.patientId, patientId: appointment.patientId,
title: appointment.title, title: appointment.title,
date: date:
@@ -139,6 +140,7 @@ export function AppointmentForm({
} }
: parsedStoredData : parsedStoredData
? { ? {
userId: user?.id,
patientId: Number(parsedStoredData.patientId), patientId: Number(parsedStoredData.patientId),
date: parsedStoredData.date date: parsedStoredData.date
? typeof parsedStoredData.date === "string" ? typeof parsedStoredData.date === "string"
@@ -157,7 +159,8 @@ export function AppointmentForm({
? parsedStoredData.staff ? parsedStoredData.staff
: (staffMembers?.[0]?.id ?? undefined), : (staffMembers?.[0]?.id ?? undefined),
} }
: { : {
userId: user?.id ?? 0,
date: new Date(), date: new Date(),
title: "", title: "",
startTime: "09:00", startTime: "09:00",
@@ -262,6 +265,7 @@ export function AppointmentForm({
onSubmit({ onSubmit({
...data, ...data,
userId: Number(user?.id),
title, title,
notes, notes,
patientId, patientId,