Fix data fetch
This commit is contained in:
@@ -28,7 +28,7 @@ router = APIRouter(tags=["traffic"])
|
||||
traffic_service = TrafficService()
|
||||
logger = structlog.get_logger()
|
||||
|
||||
@router.get("/tenants/{tenant_id}/current", response_model=TrafficDataResponse)
|
||||
@router.get("/tenants/{tenant_id}/traffic/current", response_model=TrafficDataResponse)
|
||||
async def get_current_traffic(
|
||||
latitude: float = Query(..., description="Latitude"),
|
||||
longitude: float = Query(..., description="Longitude"),
|
||||
@@ -71,7 +71,7 @@ async def get_current_traffic(
|
||||
logger.error("Traffic API traceback", traceback=traceback.format_exc())
|
||||
raise HTTPException(status_code=500, detail=f"Internal server error: {str(e)}")
|
||||
|
||||
@router.get("/tenants/{tenant_id}/historical", response_model=List[TrafficDataResponse])
|
||||
@router.get("/tenants/{tenant_id}/traffic/historical", response_model=List[TrafficDataResponse])
|
||||
async def get_historical_traffic(
|
||||
latitude: float = Query(..., description="Latitude"),
|
||||
longitude: float = Query(..., description="Longitude"),
|
||||
@@ -118,7 +118,7 @@ async def get_historical_traffic(
|
||||
logger.error("Unexpected error in historical traffic API", error=str(e))
|
||||
raise HTTPException(status_code=500, detail=f"Internal server error: {str(e)}")
|
||||
|
||||
@router.post("/tenants/{tenant_id}/store")
|
||||
@router.post("/tenants/{tenant_id}/traffic/store")
|
||||
async def store_traffic_data(
|
||||
latitude: float = Query(..., description="Latitude"),
|
||||
longitude: float = Query(..., description="Longitude"),
|
||||
|
||||
Reference in New Issue
Block a user