Skip to content

Commit

Permalink
Merge pull request #525 from LACMTA:2023-api-optimization
Browse files Browse the repository at this point in the history
fix: problem with the stop_times being outside the loop
  • Loading branch information
albertkun authored May 17, 2024
2 parents 49b777d + b525b7f commit 0d15ccc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fastapi/app/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ async def get_route_details(db: AsyncSession, route_code: str, direction_id: int
if time not in times:
times.append(time)
times.sort()
stop_times.append([stop_name, {'stop_id': stop_id, 'times': times, 'shape_id': shape_id}])
stop_times.append([stop_name, {'stop_id': stop_id, 'times': times, 'shape_id': shape_id}])
# Query the trip_shapes table for the geometries of the distinct shape_ids
query = text("SELECT shape_id, ST_AsGeoJSON(geometry) FROM metro_api.trip_shapes WHERE shape_id IN :shape_ids")
result = db.execute(query, {'shape_ids': tuple(shape_ids)})
Expand Down

0 comments on commit 0d15ccc

Please sign in to comment.