17 lines
482 B
Python
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 |