From e86868fdde10968531afaffeffe6974855a42af1 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Fri, 28 Mar 2025 15:09:36 +0000 Subject: [PATCH] Update code in endpoints/playlist.get.py --- endpoints/playlist.get.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/endpoints/playlist.get.py b/endpoints/playlist.get.py index 1d301fd..c164415 100644 --- a/endpoints/playlist.get.py +++ b/endpoints/playlist.get.py @@ -1,19 +1,19 @@ -# Entity: Song +# 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.song import Song -from schemas.song import SongSchema -from helpers.song_helpers import get_all_songs +from models.playlist import Playlist +from schemas.playlist import PlaylistSchema +from helpers.playlist_helpers import get_playlist_songs router = APIRouter() -@router.get("/playlist", status_code=200, response_model=List[SongSchema]) -async def get_playlist( +@router.get("/playlist", response_model=List[PlaylistSchema], status_code=200) +async def get_playlist_songs( db: Session = Depends(get_db) ): - """Get all songs from library""" - songs = get_all_songs(db) + """Get all songs from playlist""" + songs = get_playlist_songs(db) return songs \ No newline at end of file