From 18a5e247736c15a0e359c2693e9ad8122ee9d5b0 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Fri, 28 Mar 2025 15:58:42 +0100 Subject: [PATCH] Update code in endpoints/biro.get.py --- endpoints/biro.get.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 endpoints/biro.get.py diff --git a/endpoints/biro.get.py b/endpoints/biro.get.py new file mode 100644 index 0000000..35364e4 --- /dev/null +++ b/endpoints/biro.get.py @@ -0,0 +1,18 @@ +# Entity: Biro + +from fastapi import APIRouter, Depends, status +from sqlalchemy.orm import Session +from typing import List +from core.database import get_db +from models.biro import Biro +from schemas.biro import BiroSchema +from helpers.biro_helpers import get_all_biros + +router = APIRouter() + +@router.get("/biros", status_code=200, response_model=List[BiroSchema]) +async def get_biros( + db: Session = Depends(get_db) +): + biros = get_all_biros(db) + return biros \ No newline at end of file