✨ Add /stop/{stop_id}/destinations endpoint
This commit is contained in:
@@ -9,8 +9,8 @@ from fastapi.staticfiles import StaticFiles
|
||||
from rich import print
|
||||
|
||||
from backend.db import db
|
||||
from backend.idfm_interface import IdfmInterface
|
||||
from backend.models import Line, Stop, StopArea
|
||||
from backend.idfm_interface import Destinations as IdfmDestinations, IdfmInterface
|
||||
from backend.schemas import (
|
||||
Line as LineSchema,
|
||||
TransportMode,
|
||||
@@ -214,3 +214,12 @@ async def get_next_passages(stop_id: str) -> NextPassagesSchema | None:
|
||||
ts=service_delivery.ResponseTimestamp.timestamp(),
|
||||
passages=by_line_by_dst_passages,
|
||||
)
|
||||
|
||||
|
||||
@app.get("/stop/{stop_id}/destinations")
|
||||
async def get_stop_destinations(
|
||||
stop_id: int,
|
||||
) -> IdfmDestinations | None:
|
||||
destinations = await idfm_interface.get_destinations(stop_id)
|
||||
|
||||
return destinations
|
||||
|
Reference in New Issue
Block a user