Update code in endpoints/playlist.get.py
This commit is contained in:
parent
ed71e30379
commit
333ed09a49
@ -2,16 +2,16 @@ from fastapi import APIRouter, Depends, HTTPException, status
|
|||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
from typing import List
|
from typing import List
|
||||||
from core.database import get_db
|
from core.database import get_db
|
||||||
from models.playlist import Playlist
|
from models.food import Food
|
||||||
from schemas.playlist import PlaylistSchema
|
from schemas.food import FoodSchema
|
||||||
from helpers.playlist_helpers import get_all_playlists
|
from helpers.food_helpers import get_pantry_foods
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
@router.get("/playlist", status_code=200, response_model=List[PlaylistSchema])
|
@router.get("/pantry", status_code=200, response_model=List[FoodSchema])
|
||||||
async def get_playlists(
|
async def get_pantry_foods(
|
||||||
db: Session = Depends(get_db)
|
db: Session = Depends(get_db)
|
||||||
):
|
):
|
||||||
"""Get all playlists"""
|
"""Get all foods in pantry"""
|
||||||
playlists = get_all_playlists(db)
|
foods = get_pantry_foods(db)
|
||||||
return playlists
|
return foods
|
Loading…
x
Reference in New Issue
Block a user