aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/app/routes/home.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/app/routes/home.tsx')
-rw-r--r--src/frontend/app/routes/home.tsx16
1 files changed, 14 insertions, 2 deletions
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);
};