fix: resolve appointment form validation and socket connection issues
- Fix status enum in browser.ts (uppercase → lowercase values) - Fix date validation (z.string → z.coerce.date) so form accepts Date objects - Add missing type/userId/title fields to browser.ts appointment schema - Replace nested PatientSearch Select with simple inline Input to fix patient selection - Fix mutationFn to throw on non-ok responses so backend errors surface correctly - Connect socket.io directly to backend (port 5000) instead of Vite proxy to fix AggregateError on startup Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -274,7 +274,9 @@ export default function AppointmentsPage() {
|
||||
"/api/appointments/upsert",
|
||||
appointment
|
||||
);
|
||||
return await res.json();
|
||||
const body = await res.json();
|
||||
if (!res.ok) throw new Error(body?.message || "Failed to create appointment");
|
||||
return body;
|
||||
},
|
||||
onSuccess: (appointment) => {
|
||||
toast({
|
||||
|
||||
Reference in New Issue
Block a user