Add GET endpoint for /birds

This commit is contained in:
Backend IM Bot 2025-03-27 03:19:13 -05:00
parent e4a863bef3
commit 2dad31ee49

18
endpoints/birds.get.py Normal file
View File

@ -0,0 +1,18 @@
# Entity: Bird
from fastapi import APIRouter, Depends, status
from typing import List
from core.database import get_db
from sqlalchemy.orm import Session
from models.bird import Bird
from schemas.bird import BirdSchema
from helpers.bird_helpers import get_all_birds
router = APIRouter()
@router.get("/birds", status_code=200, response_model=List[BirdSchema])
async def get_birds(
db: Session = Depends(get_db)
):
birds = get_all_birds(db)
return birds