From 8a985d333cd1f18a932a5313bea81a7ed44868ed Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Tue, 11 Mar 2025 18:31:51 +0000 Subject: [PATCH] feat: Update endpoint countries --- app/api/endpoints/countries.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/api/endpoints/countries.py b/app/api/endpoints/countries.py index e69de29..4b11f17 100644 --- a/app/api/endpoints/countries.py +++ b/app/api/endpoints/countries.py @@ -0,0 +1,7 @@ +@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] \ No newline at end of file