Files
alla-tms/plans/training-type-review.md
2026-07-16 09:53:14 +07:00

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:

  1. Review the React Hook Form configuration.
  2. Review the Zod schema.
  3. Review the Select component.
  4. Ensure the field is correctly registered.
  5. Ensure the Select binds:
    • value
    • onValueChange
  6. Ensure defaultValues contains a valid default or empty string.
  7. 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