♻️ Fix /stop/ endpoints inconsistency

This commit is contained in:
2023-05-08 13:44:44 +02:00
parent 93047c8706
commit d15fee75ca
2 changed files with 5 additions and 7 deletions

View File

@@ -175,15 +175,14 @@ async def get_stop(
)
)
# print(f"{stops = }", flush=True)
formatted.extend(_format_stop(stop) for stop in stops.values())
return formatted
# TODO: Cache response for 30 secs ?
@app.get("/stop/nextPassages/{stop_id}")
async def get_next_passages(stop_id: str) -> NextPassagesSchema | None:
@app.get("/stop/{stop_id}/nextPassages")
async def get_next_passages(stop_id: int) -> NextPassagesSchema | None:
res = await idfm_interface.get_next_passages(stop_id)
if res is None:
return None
@@ -250,8 +249,7 @@ async def get_stop_destinations(
return destinations
# TODO: Rename endpoint -> /stop/{stop_id}/shape
@app.get("/stop_shape/{stop_id}")
@app.get("/stop/{stop_id}/shape")
async def get_stop_shape(stop_id: int) -> StopShapeSchema | None:
connection_area = None