Skip to content

Commit

Permalink
Fix search issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ZoutigeWolf committed Nov 7, 2024
1 parent e6a941a commit 217ded6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions routers/stops.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ async def get_all_stops(
if (lat is None) != (lon is None):
raise HTTPException(status_code=400, detail="Only part of coordinate supplied")

if not name and search:
if (not name) and search:
return []

q = (
select(StopGTFS)
.distinct(col(StopGTFS.name))
)

if search:
q = q.distinct(col(StopGTFS.name))

if name is not None:
if search:
q = (
Expand Down

0 comments on commit 217ded6

Please sign in to comment.