Update code in endpoints/playlist.get.py
This commit is contained in:
parent
73acadeaa5
commit
50f3404602
@ -0,0 +1,19 @@
|
||||
# Entity: Song
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, status
|
||||
from sqlalchemy.orm import Session
|
||||
from typing import List
|
||||
from core.database import get_db
|
||||
from models.song import Song
|
||||
from schemas.song import SongSchema
|
||||
from helpers.song_helpers import get_all_songs
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.get("/playlist", status_code=200, response_model=List[SongSchema])
|
||||
async def get_playlist(
|
||||
db: Session = Depends(get_db)
|
||||
):
|
||||
"""Get all songs from library"""
|
||||
songs = get_all_songs(db)
|
||||
return songs
|
Loading…
x
Reference in New Issue
Block a user