12 lines
367 B
Python
12 lines
367 B
Python
# Entity: Country
|
|
|
|
from fastapi import APIRouter, Depends, status
|
|
from sqlalchemy.orm import Session
|
|
from core.database import get_db
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/countries", status_code=status.HTTP_200_OK, response_model=List[CountrySchema])
|
|
async def get_countries(db: Session = Depends(get_db)):
|
|
countries = db.query(Country).all()
|
|
return countries |