1.0 KiB
1.0 KiB
Investigate the "ประเภทการอบรม" dropdown validation.
Current issue: The form displays:
"Invalid input: expected string, received undefined"
instead of a friendly Thai validation message.
Tasks:
- Review the React Hook Form configuration.
- Review the Zod schema.
- Review the Select component.
- Ensure the field is correctly registered.
- Ensure the Select binds:
- value
- onValueChange
- Ensure defaultValues contains a valid default or empty string.
- Replace raw Zod error messages with Thai validation messages.
Training Type options should be:
-
INTERNAL Label: อบรมภายใน (Internal Training)
-
EXTERNAL Label: อบรมภายนอก (Public Training)
-
ONLINE Label: e-Learning / Online Course
-
OJT Label: On the Job Training (OJT)
Validation message:
กรุณาเลือกประเภทการอบรม
Verify:
- Create mode
- Edit mode
- Reset form
- Validation after submit
Return:
- Root cause
- Files changed
- Fixed code
- Regression checklist