highlife-15d6hb/endpoints/playlist.get.py
2025-03-29 21:19:02 +00:00

17 lines
513 B
Python

from fastapi import APIRouter, Depends, HTTPException, status
from sqlalchemy.orm import Session
from typing import List
from core.database import get_db
from models.food import Food
from schemas.food import FoodSchema
from helpers.food_helpers import get_pantry_foods
router = APIRouter()
@router.get("/pantry", status_code=200, response_model=List[FoodSchema])
async def get_pantry_foods(
db: Session = Depends(get_db)
):
"""Get all foods in pantry"""
foods = get_pantry_foods(db)
return foods