Add GET endpoint for /alcohol

This commit is contained in:
Backend IM Bot 2025-03-25 14:44:30 -05:00
parent 047c624d1d
commit 20fd710db7

17
endpoints/alcohol.get.py Normal file
View File

@ -0,0 +1,17 @@
# 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