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:
Gitead
2026-04-23 23:30:08 -04:00
parent 4f8a211bf1
commit a279a3e7c1
5 changed files with 287 additions and 91 deletions

View File

@@ -107,12 +107,15 @@ export const StaffUncheckedCreateInputObjectSchema = z.object({
export const AppointmentUncheckedCreateInputObjectSchema = z.object({
id: z.number().int().optional(),
patientId: z.number().int(),
userId: z.number().int().optional(),
staffId: z.number().int().optional(),
date: z.string(),
title: z.string().optional(),
date: z.coerce.date(),
startTime: z.string(),
endTime: z.string(),
type: z.string(),
status: z
.enum(["SCHEDULED", "COMPLETED", "CANCELLED", "NO_SHOW"])
.enum(["scheduled", "confirmed", "completed", "cancelled", "no-show"])
.optional(),
notes: z.string().optional(),
});