2025-03-11 18:31:51 +00:00

7 lines
298 B
Python

@router.get("/countries", response_model=List[CountryResponse])
async def get_countries(db: Session = Depends(get_db)):
"""
Fetch the list of countries from the database.
"""
countries = db.query(Country).all()
return [CountryResponse.from_orm(country) for country in countries]