Add GET endpoint for dogs

This commit is contained in:
Backend IM Bot 2025-03-26 22:00:05 +01:00
parent f51d4e03da
commit 402d080c2b

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

@ -0,0 +1,18 @@
# Entity: Dog
from fastapi import APIRouter, Depends, status
from sqlalchemy.orm import Session
from typing import List
from core.database import get_db
from models.dog import Dog
from schemas.dog import DogSchema
from helpers.dog_helpers import get_all_dogs
router = APIRouter()
@router.get("/dogs", status_code=200, response_model=List[DogSchema])
async def get_dogs(
db: Session = Depends(get_db)
):
dogs = get_all_dogs(db)
return dogs