Add bulk POI distances endpoint for decoupled loading
New GET /api/poi/distances/bulk returns all POI distances keyed by listing ID, allowing the frontend to fetch distances separately from the listing stream and keep the stream on the cached path.
This commit is contained in:
parent
2f3d2dc480
commit
3885fd52fe
3 changed files with 46 additions and 1 deletions
|
|
@ -4,6 +4,6 @@ export { fetchListingGeoJSON, refreshListings } from './listingService';
|
|||
export { streamListingGeoJSON, type StreamingProgress } from './streamingService';
|
||||
export { fetchTasksForUser, fetchTaskStatus, cancelTask, clearAllTasks, type CancelTaskResponse, type ClearAllTasksResponse } from './taskService';
|
||||
export { checkBackendHealth, type HealthStatus, type HealthCheckResult } from './healthService';
|
||||
export { fetchUserPOIs, createPOI, updatePOI, deletePOI, triggerPOICalculation, fetchPOIDistances } from './poiService';
|
||||
export { fetchUserPOIs, createPOI, updatePOI, deletePOI, triggerPOICalculation, fetchPOIDistances, fetchBulkPOIDistances } from './poiService';
|
||||
export { fetchDecisions, setDecision, clearDecision } from './decisionService';
|
||||
export { fetchListingDetail } from './listingDetailService';
|
||||
|
|
|
|||
|
|
@ -62,3 +62,12 @@ export async function fetchPOIDistances(
|
|||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function fetchBulkPOIDistances(
|
||||
user: AuthUser,
|
||||
listingType: 'RENT' | 'BUY' = 'RENT'
|
||||
): Promise<Record<number, POIDistanceInfo[]>> {
|
||||
return apiRequest<Record<number, POIDistanceInfo[]>>(user, '/api/poi/distances/bulk', {
|
||||
params: { listing_type: listingType },
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue