13 lines
471 B
Python
13 lines
471 B
Python
from fastapi import APIRouter, Depends
|
|
from typing import List
|
|
from sqlalchemy.orm import Session
|
|
from core.database import get_db
|
|
from schemas.country import CountrySchema
|
|
from helpers.country_helpers import get_european_countries
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/countries", status_code=200, response_model=List[CountrySchema])
|
|
async def get_european_countries_endpoint(db: Session = Depends(get_db)):
|
|
countries = get_european_countries(db)
|
|
return countries |