From 6192730d1b7b0d08095d7da88caba73fd07fe99e Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Sun, 25 Jan 2026 21:35:36 +0100 Subject: Bring back basic stop search --- src/frontend/app/routes/home.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/frontend/app/routes') diff --git a/src/frontend/app/routes/home.tsx b/src/frontend/app/routes/home.tsx index 3e7f12d..ff415fd 100644 --- a/src/frontend/app/routes/home.tsx +++ b/src/frontend/app/routes/home.tsx @@ -143,8 +143,20 @@ export default function StopList() { return; } - // Placeholder for future backend search - setSearchResults([]); + try { + const response = await fetch( + `/api/stops/search?q=${encodeURIComponent(searchQuery)}` + ); + if (response.ok) { + const results = await response.json(); + setSearchResults(results); + } else { + setSearchResults([]); + } + } catch (error) { + console.error("Search failed:", error); + setSearchResults([]); + } }, 300); }; -- cgit v1.3