bigmama-8r3aid/endpoints/alcohol.get.py
2025-03-25 14:44:30 -05:00

17 lines
482 B
Python

# Entity: Alcohol
from fastapi import APIRouter, Depends, status
from sqlalchemy.orm import Session
from typing import List
from core.database import get_db
from core.models.alcohol import Alcohol
from core.schemas.alcohol import AlcoholSchema
router = APIRouter()
@router.get("/alcohol", status_code=200, response_model=List[AlcoholSchema])
async def get_alcohol_brands(
db: Session = Depends(get_db)
):
alcohol_brands = db.query(Alcohol).all()
return alcohol_brands