From 5e296b6e5cb7d146d8ff286d26addb08f1544cca Mon Sep 17 00:00:00 2001 From: Tudor Date: Wed, 4 Feb 2026 11:38:56 +0000 Subject: [PATCH] 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 --- backend/app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/app.py b/backend/app.py index 33ea6db..c8ff2c9 100644 --- a/backend/app.py +++ b/backend/app.py @@ -350,7 +350,11 @@ async def get_schools( "page": page, "page_size": page_size, "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 else None, }