Update code in endpoints/playlist.get.py
This commit is contained in:
parent
33eb209f1a
commit
ed71e30379
@ -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.food import Food
|
from models.playlist import Playlist
|
||||||
from schemas.food import FoodSchema
|
from schemas.playlist import PlaylistSchema
|
||||||
from helpers.food_helpers import get_all_foods
|
from helpers.playlist_helpers import get_all_playlists
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
@router.get("/foods", status_code=200, response_model=List[FoodSchema])
|
@router.get("/playlist", status_code=200, response_model=List[PlaylistSchema])
|
||||||
async def get_foods(
|
async def get_playlists(
|
||||||
db: Session = Depends(get_db)
|
db: Session = Depends(get_db)
|
||||||
):
|
):
|
||||||
"""Get all foods for shopping"""
|
"""Get all playlists"""
|
||||||
foods = get_all_foods(db)
|
playlists = get_all_playlists(db)
|
||||||
return foods
|
return playlists
|
Loading…
x
Reference in New Issue
Block a user