shoe-store-z9mjrn/endpoints/shoes-collection.get.py
2025-03-27 12:54:55 +00:00

19 lines
541 B
Python

# Entity: Shoe
from fastapi import APIRouter, Depends, HTTPException, status
from sqlalchemy.orm import Session
from typing import List
from core.database import get_db
from models.shoe import Shoe
from schemas.shoe import ShoeSchema
from helpers.shoe_helpers import get_all_shoes
router = APIRouter()
@router.get("/shoes-collection", response_model=List[ShoeSchema], status_code=200)
async def get_shoes_collection(
db: Session = Depends(get_db)
):
"""Get all shoes in collection"""
shoes = get_all_shoes(db)
return shoes