diff --git a/endpoints/signup.post.py b/endpoints/signup.post.py index 51ae03d..0850a6b 100644 --- a/endpoints/signup.post.py +++ b/endpoints/signup.post.py @@ -1,30 +1,32 @@ from fastapi import APIRouter, HTTPException -customers = [] # In-memory storage +playlists = [ + { + "id": "playlist1", + "songs": [ + {"id": "song1", "title": "Song One", "artist": "Artist A"}, + {"id": "song2", "title": "Song Two", "artist": "Artist B"} + ] + } +] router = APIRouter() -@router.post("/signup") -async def list_customers( - store_id: str = "default_store", - page: int = 1, - limit: int = 10 +@router.post("/playlist/songs") +async def get_playlist_songs( + playlist_id: str = "playlist1" ): - """Get list of store customers""" - if not any(c["store_id"] == store_id for c in customers): - raise HTTPException(status_code=400, detail="Store not found") - - store_customers = [c for c in customers if c["store_id"] == store_id] - start = (page - 1) * limit - end = start + limit + """Fetch songs from a playlist""" + playlist = next((p for p in playlists if p["id"] == playlist_id), None) + if not playlist: + raise HTTPException(status_code=400, detail="Playlist not found") return { - "message": "Customers retrieved successfully", - "store_id": store_id, - "customers": store_customers[start:end], - "pagination": { - "page": page, - "total": len(store_customers), - "pages": (len(store_customers) + limit - 1) // limit + "message": "Songs fetched successfully", + "playlist_id": playlist_id, + "songs": playlist["songs"], + "features": { + "total_songs": len(playlist["songs"]), + "can_shuffle": True } } \ No newline at end of file