16 lines
595 B
Python
16 lines
595 B
Python
from fastapi import APIRouter, Depends
|
|
from typing import List
|
|
from sqlalchemy.orm import Session
|
|
from core.database import get_db
|
|
from schemas.routing_api import RoutingAPISchema
|
|
from helpers.routing_api_helpers import get_all_routing_apis, get_routing_api_schema
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/Route", status_code=200, response_model=List[RoutingAPISchema])
|
|
async def get_routes(
|
|
db: Session = Depends(get_db)
|
|
):
|
|
routing_apis = get_all_routing_apis(db)
|
|
routing_api_schemas = [get_routing_api_schema(routing_api) for routing_api in routing_apis]
|
|
return routing_api_schemas |