Add GET endpoint for /trees
This commit is contained in:
parent
38dfe42087
commit
5e59b61c8b
12
endpoints/trees.get.py
Normal file
12
endpoints/trees.get.py
Normal file
@ -0,0 +1,12 @@
|
||||
# Entity: Tree
|
||||
|
||||
from fastapi import APIRouter, Depends
|
||||
from sqlalchemy.orm import Session
|
||||
from app.api.db.database import get_db
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.get("/trees", status_code=200, response_model=List[TreeSchema])
|
||||
async def get_trees(db: Session = Depends(get_db)):
|
||||
trees = db.query(Tree).all()
|
||||
return trees
|
Loading…
x
Reference in New Issue
Block a user