Skip to content

🐛 fix: pass postcode to agent address lookup so search actually fires#788

Merged
arturasmckwcz merged 2 commits into
developfrom
arturas/fix-agent-address-lookup-postcode
Jul 12, 2026
Merged

🐛 fix: pass postcode to agent address lookup so search actually fires#788
arturasmckwcz merged 2 commits into
developfrom
arturas/fix-agent-address-lookup-postcode

Conversation

@arturasmckwcz

Copy link
Copy Markdown
Collaborator

Summary

  • useAgentAddressLookup never sent postcode to GET /agent/register/search, so the backend guard (!postcode) always short-circuited and returned empty data
  • The street-based agent prepopulation during self-registration was completely broken — the lookup never ran regardless of street length
  • Fix: accept addressPostcode in the hook, debounce it, include it in the query string, and require it (alongside street ≥ 3 chars) before enabling the request

Test plan

  • Open the agent self-registration flow (/agent/register?token=...)
  • Type a street with ≥ 3 chars and a valid postcode — confirm the match banner appears when the address corresponds to an existing agent
  • Confirm dismissing the banner and completing the create-new-agent flow still works
  • Confirm the join flow (clicking "Use this org") still routes correctly to the membership request

🤖 Generated with Claude Code

arturasmckwcz and others added 2 commits July 12, 2026 11:13
The hook never sent postcode to GET /agent/register/search, so the
backend guard (!postcode) always returned empty — street-based
prepopulation was completely broken.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lone

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@arturasmckwcz arturasmckwcz merged commit bfb801e into develop Jul 12, 2026
1 check passed
@arturasmckwcz arturasmckwcz deleted the arturas/fix-agent-address-lookup-postcode branch July 12, 2026 11:28
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