19 lines
569 B
Python
19 lines
569 B
Python
# Entity: Playlist
|
|
|
|
from fastapi import APIRouter, Depends, HTTPException, status
|
|
from sqlalchemy.orm import Session
|
|
from typing import List
|
|
from core.database import get_db
|
|
from models.playlist import Playlist
|
|
from schemas.playlist import PlaylistSchema
|
|
from helpers.playlist_helpers import get_playlist_songs
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/playlist", response_model=List[PlaylistSchema], status_code=200)
|
|
async def get_playlist_songs(
|
|
db: Session = Depends(get_db)
|
|
):
|
|
"""Get all songs from playlist"""
|
|
songs = get_playlist_songs(db)
|
|
return songs |