diff --git a/endpoints/school.get.py b/endpoints/school.get.py index e69de29..c5dfb78 100644 --- a/endpoints/school.get.py +++ b/endpoints/school.get.py @@ -0,0 +1,19 @@ +# Entity: School + +from fastapi import APIRouter, Depends, HTTPException, status +from sqlalchemy.orm import Session +from typing import List +from core.database import get_db +from models.school import School +from schemas.school import SchoolSchema +from helpers.school_helpers import get_all_schools + +router = APIRouter() + +@router.get("/school", response_model=List[SchoolSchema], status_code=200) +async def get_schools( + db: Session = Depends(get_db) +): + """Get all schools""" + schools = get_all_schools(db) + return schools \ No newline at end of file