Skip to content

fix: create opportunity button silently no-ops#786

Merged
arturasmckwcz merged 1 commit into
developfrom
arturas/fix-create-opportunity-silent-fail
Jul 11, 2026
Merged

fix: create opportunity button silently no-ops#786
arturasmckwcz merged 1 commit into
developfrom
arturas/fix-create-opportunity-silent-fail

Conversation

@arturasmckwcz

Copy link
Copy Markdown
Collaborator

Summary

  • detailsMethods used createOpportunityDetailsSchema which requires a title field
  • But title lives in the separate headerMethods form — so detailsMethods.trigger() always returned false
  • handleCreate hit the early return guard every time and never called createOpportunity
  • No visible feedback to the user (button not disabled, no error message) because title error lands on a key that no rendered field displays

Fix: export createNewOpportunityDetailsSchema (omits title via Zod .omit()) and use it in NewOpportunity. The existing createOpportunityDetailsSchema + OpportunityDetailsFormData are unchanged — OpportunityDetailsEdit (where title IS part of that section) continues to work correctly.

Test plan

  • Open /dashboard/opportunities/new, fill in the form as an agent, click "Create opportunity" — request should fire and redirect on success
  • Verify event-type, regular-type, and accompanying-type submissions all proceed past the button
  • Verify editing an existing opportunity (OpportunityDetailsEdit) still validates title

🤖 Generated with Claude Code

detailsMethods used createOpportunityDetailsSchema which requires a
`title` field, but `title` lives in headerMethods — so detailsMethods
validation always failed and handleCreate returned early without calling
createOpportunity.

Extract createNewOpportunityDetailsSchema (omits `title`) and use it
in NewOpportunity so validation only covers fields that form actually owns.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@arturasmckwcz arturasmckwcz merged commit a84db03 into develop Jul 11, 2026
1 check passed
@arturasmckwcz arturasmckwcz deleted the arturas/fix-create-opportunity-silent-fail branch July 11, 2026 12:39
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