Skip to content

feat(donations): wire up donate form with validation#57

Merged
criskell merged 2 commits intomainfrom
feat/donate-form-validation
Mar 31, 2026
Merged

feat(donations): wire up donate form with validation#57
criskell merged 2 commits intomainfrom
feat/donate-form-validation

Conversation

@herissonnogueira
Copy link
Copy Markdown
Collaborator

Summary

  • Connect donate form with react-hook-form + zod for client-side validation
  • Wire up form submit to call POST /api/donations
  • Refactor PaymentMethodButton to controlled component
  • Add i18n validation keys (en, pt, es)

@criskell
Copy link
Copy Markdown
Owner

@herissonnogueira attach video

taxId: z
.string()
.min(1, t('validation.tax_id_required'))
.refine((val) => val.replace(/\D/g, '').length === 11, {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this verification to a utility file.

@herissonnogueira
Copy link
Copy Markdown
Collaborator Author

Done, extracted to getApiErrorMessage util in web/src/lib/utils/get-api-error-message.ts
chrome_cIYE51iTj3

@criskell criskell merged commit c7ec4b1 into main Mar 31, 2026
1 check passed
@criskell criskell deleted the feat/donate-form-validation branch March 31, 2026 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants