diff --git a/shared/schemas/trainingReportSchema.ts b/shared/schemas/trainingReportSchema.ts index 2a504d1..8afc4fa 100644 --- a/shared/schemas/trainingReportSchema.ts +++ b/shared/schemas/trainingReportSchema.ts @@ -9,12 +9,12 @@ export const courseEventAttendeeSchema = z.object({ export const trainingReportSchema = z.object({ id: z.number().int().positive().optional(), - course_id: z.number().int(), + course_id: z.number({ invalid_type_error: "Must select a training" }).int(), event_date: z .string() .refine( (val) => !isNaN(Date.parse(val)), - "event_date must be a valid ISO date string" + "Must be a valid date" ), remarks: z.string().nullable().optional(), attendees: z.array(courseEventAttendeeSchema).default([]), diff --git a/ui/package-lock.json b/ui/package-lock.json index da4cbea..46c81a2 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -21,7 +21,7 @@ "clsx": "^2.1.1", "lucide-vue-next": "^0.539.0", "pinia": "^3.0.3", - "reka-ui": "^2.5.0", + "reka-ui": "^2.6.0", "tailwind-merge": "^3.3.1", "tailwindcss": "^4.1.11", "tw-animate-css": "^1.3.6", @@ -3235,9 +3235,9 @@ } }, "node_modules/reka-ui": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/reka-ui/-/reka-ui-2.5.0.tgz", - "integrity": "sha512-81aMAmJeVCy2k0E6x7n1kypDY6aM1ldLis5+zcdV1/JtoAlSDck5OBsyLRJU9CfgbrQp1ImnRnBSmC4fZ2fkZQ==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/reka-ui/-/reka-ui-2.6.0.tgz", + "integrity": "sha512-NrGMKrABD97l890mFS3TNUzB0BLUfbL3hh0NjcJRIUSUljb288bx3Mzo31nOyUcdiiW0HqFGXJwyCBh9cWgb0w==", "license": "MIT", "dependencies": { "@floating-ui/dom": "^1.6.13", diff --git a/ui/package.json b/ui/package.json index 9771d5d..f83bc55 100644 --- a/ui/package.json +++ b/ui/package.json @@ -25,7 +25,7 @@ "clsx": "^2.1.1", "lucide-vue-next": "^0.539.0", "pinia": "^3.0.3", - "reka-ui": "^2.5.0", + "reka-ui": "^2.6.0", "tailwind-merge": "^3.3.1", "tailwindcss": "^4.1.11", "tw-animate-css": "^1.3.6", diff --git a/ui/src/components/trainingReport/trainingReportForm.vue b/ui/src/components/trainingReport/trainingReportForm.vue index eab74bb..d32b307 100644 --- a/ui/src/components/trainingReport/trainingReportForm.vue +++ b/ui/src/components/trainingReport/trainingReportForm.vue @@ -1,7 +1,7 @@