From 50f3404602fed46717e16d1f5066564097425c81 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Fri, 28 Mar 2025 15:04:05 +0000 Subject: [PATCH] Update code in endpoints/playlist.get.py --- endpoints/playlist.get.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/endpoints/playlist.get.py b/endpoints/playlist.get.py index e69de29..1d301fd 100644 --- a/endpoints/playlist.get.py +++ b/endpoints/playlist.get.py @@ -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 \ No newline at end of file