diff --git a/endpoints/countries.get.py b/endpoints/countries.get.py new file mode 100644 index 0000000..6396d07 --- /dev/null +++ b/endpoints/countries.get.py @@ -0,0 +1,12 @@ +# 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 \ No newline at end of file