Add GET endpoint for /dogs
This commit is contained in:
parent
4f35a0704f
commit
9d2f95e47a
@ -4,15 +4,15 @@ from fastapi import APIRouter, Depends, HTTPException, status
|
||||
from sqlalchemy.orm import Session
|
||||
from typing import List
|
||||
from core.database import get_db
|
||||
from core.models.dog import Dog
|
||||
from core.schemas.dog import DogSchema
|
||||
from models.dog import Dog
|
||||
from schemas.dog import DogSchema
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.get("/dogs", status_code=200, response_model=List[DogSchema])
|
||||
async def get_dog_breeds(
|
||||
async def get_dogs(
|
||||
db: Session = Depends(get_db)
|
||||
):
|
||||
"""Get all dog breeds"""
|
||||
"""Get all dogs"""
|
||||
dogs = db.query(Dog).all()
|
||||
return dogs
|
Loading…
x
Reference in New Issue
Block a user