Skip to content

feat: store location coordinates in createRequest API payload instead…#1596

Open
rudra-sai-nag-aleti wants to merge 4 commits into
testfrom
feature-store-location-coordinates-in-create-request-1475
Open

feat: store location coordinates in createRequest API payload instead…#1596
rudra-sai-nag-aleti wants to merge 4 commits into
testfrom
feature-store-location-coordinates-in-create-request-1475

Conversation

@rudra-sai-nag-aleti

Copy link
Copy Markdown

Changes

  • 'HelpRequestForm.jsx' — Added 'locationCoordinates' state. When geolocation
    succeeds, stores { latitude, longitude } alongside the display address
  • 'usePlacesSearchBox.jsx' — Updated 'handleSelectSuggestion' to accept full
    suggestion object and extract coordinates (lat, lon) from OpenStreetMap response
  • 'mapHelpRequestPayload.js' — 'requestLocation' now sends
    '{ latitude, longitude }' when coordinates are available, falls back to
    address string if not

Behavior

  • UI still shows human-readable address to the user — no change
  • API payload sends coordinates instead of address string for DB storage
  • Fallback to address string if coordinates are unavailable

Tests

  • Updated 'usePlacesSearchBox.test.jsx' — updated suggestion selection test
    to pass full suggestion object with coordinates
  • Updated 'mapHelpRequestPayload.test.js' — added test for coordinates payload,
    updated existing location test
  • Added 2 new tests to 'HelpRequestForm.test.jsx' — verifies coordinates stored
    when geolocation succeeds

@rudra-sai-nag-aleti rudra-sai-nag-aleti requested a review from a team as a code owner June 22, 2026 18:36
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/pages/HelpRequest/HelpRequestForm.jsx 72.17% <100.00%> (+0.15%) ⬆️
.../pages/HelpRequest/location/usePlacesSearchBox.jsx 100.00% <100.00%> (ø)
src/utils/mapHelpRequestPayload.js 100.00% <100.00%> (ø)

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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