You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Phase 3 frontend work: properties.js gains a new fetchMapViewport function targeting /api/v1/map/viewport and refactors existing API functions to accept an injectable HTTP client. The Pinia map store adds viewportMode/viewportItems state and a fetchViewport action, while fetchProperties becomes a thin delegate. MapExplorer.vue switches all fetch calls to fetchViewport. Test glob broadened to cover all API test files.
Changes
Map Viewport Frontend Integration
Layer / File(s)
Summary
fetchMapViewport API function and injectable client frontend/src/api/properties.js, frontend/src/api/properties.test.mjs, frontend/package.json
fetchMapViewport is added to call /api/v1/map/viewport with cleanParams; existing functions gain an optional injectable client parameter. A stub-based unit test verifies endpoint, cleaned params (strips propertyType, minDeposit, maxDeposit), and response shape. Test script glob broadened to src/api/*.test.mjs.
mapStorefetchViewport action and viewport state frontend/src/store/mapStore.js
Adds viewportMode and viewportItems state fields. Introduces fetchViewport async action using requestSeq cancellation that calls fetchMapViewport, populates viewport state, derives properties by filtering type === 'PROPERTY', and sets totalCount. Clears viewport state on error. fetchProperties delegates to fetchViewport.
MapExplorer.vue wired to fetchViewport frontend/src/views/MapExplorer.vue
Replaces all store.fetchProperties calls with store.fetchViewport in refreshFromMapBounds (uninitialized-map fallback and bounds-scoped fetch) and in the onMounted map-SDK failure path.
Phase plan and status completed phases/map-viewport-zoom/phase3-frontend-map-viewport-api.md, phases/map-viewport-zoom/phase3.status.json
Phase plan specifies exact files changed and marks all checklist items as done. Status JSON records completed with updated timestamp and detail message.
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related PRs
ssafy-salman/salmanhae#12: Previously established fetchProperties/fetchPropertyDetail in properties.js, the map store's fetchProperties action, and the map-idle refresh in MapExplorer.vue — the exact surface extended by this PR.
ssafy-salman/salmanhae#54: Introduced the backend /api/v1/map/viewport endpoint whose mode, items, and totalCount response shape is consumed by the new fetchMapViewport function here.
ssafy-salman/salmanhae#56: Implemented and validated the /api/v1/map/viewport backend behavior that mapStore.fetchViewport and MapExplorer.vue are now wired to call.
Suggested labels
ai-generated
🐇 From /properties I used to roam,
Now /map/viewport is my new home! cleanParams trims what need not be sent, fetchViewport knows just what was meant.
🗺️ Zoom in, zoom out — the map is bright,
Every viewport pixel just right! ✨
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Linked Issue
closes #57
Tests
Summary by CodeRabbit