diff --git a/endpoints/planets.get.py b/endpoints/planets.get.py new file mode 100644 index 0000000..e792a0a --- /dev/null +++ b/endpoints/planets.get.py @@ -0,0 +1,14 @@ +# Entity: Planet + +from fastapi import APIRouter, Depends, HTTPException, status +from sqlalchemy.orm import Session +from app.api.db.database import get_db + +router = APIRouter() + +@router.get("/planets", response_model=List[PlanetSchema]) +async def get_planets( + db: Session = Depends(get_db) +): + planets = db.query(Planet).all() + return planets \ No newline at end of file