Update code in endpoints/biros.get.py
This commit is contained in:
parent
18a5e24773
commit
2d361be19e
18
endpoints/biros.get.py
Normal file
18
endpoints/biros.get.py
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user