Skip to content

fix(pocketMoney): Add Money button does nothing#105

Merged
lokeshwardewangan merged 1 commit into
masterfrom
fix/add-money-submit
Jun 12, 2026
Merged

fix(pocketMoney): Add Money button does nothing#105
lokeshwardewangan merged 1 commit into
masterfrom
fix/add-money-submit

Conversation

@lokeshwardewangan

Copy link
Copy Markdown
Owner

defaultValues.date was an empty string. The Zod schema requires dd-mm-yyyy, so RHF's handleSubmit failed validation before the inner handler could inject getTodayDate(). The form has no UI for the date field, so errors.date was silently set and clicking "Add Money" appeared to do nothing.

Seed defaultValues.date (and the post-success reset()) with getTodayDate(). Handler still re-injects today on submit, so a form left open past midnight still posts the correct date.

Test plan

  • Add Money page → enter amount + source → click Add Money → toast fires, row appears in history.
  • Without leaving the page, add another → second submit also works.

defaultValues.date was '', which failed the Zod dd-mm-yyyy regex
before handleSubmit could inject getTodayDate(). The form had no
UI to render the resulting errors.date, so clicking Add Money
silently did nothing. Default to today's date up front (and on
reset) — the handler still re-injects today on submit.
@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api-budgetter Ready Ready Preview, Comment Jun 12, 2026 6:11pm
budgetter Ready Ready Preview, Comment Jun 12, 2026 6:11pm

@lokeshwardewangan lokeshwardewangan merged commit c038a1c into master Jun 12, 2026
6 checks passed
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.

1 participant