From 20fd710db78f2dc5cbb6341905db70bbeca069f1 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Tue, 25 Mar 2025 14:44:30 -0500 Subject: [PATCH] Add GET endpoint for /alcohol --- endpoints/alcohol.get.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 endpoints/alcohol.get.py diff --git a/endpoints/alcohol.get.py b/endpoints/alcohol.get.py new file mode 100644 index 0000000..2abb466 --- /dev/null +++ b/endpoints/alcohol.get.py @@ -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 \ No newline at end of file