Fix backend API to return location_info instead of search_location
The frontend expects location_info with coordinates array, but backend was returning search_location with lat/lng keys. This fix enables the map toggle to appear for location-based searches. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -350,7 +350,11 @@ async def get_schools(
|
|||||||
"page": page,
|
"page": page,
|
||||||
"page_size": page_size,
|
"page_size": page_size,
|
||||||
"total_pages": (total + page_size - 1) // page_size if page_size > 0 else 0,
|
"total_pages": (total + page_size - 1) // page_size if page_size > 0 else 0,
|
||||||
"search_location": {"postcode": postcode, "radius": radius, "lat": search_coords[0], "lng": search_coords[1]}
|
"location_info": {
|
||||||
|
"postcode": postcode,
|
||||||
|
"radius": radius * 1.60934, # Convert miles to km for frontend display
|
||||||
|
"coordinates": [search_coords[0], search_coords[1]]
|
||||||
|
}
|
||||||
if search_coords
|
if search_coords
|
||||||
else None,
|
else None,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user