I want to add another tab to the admin panel viewed on /admin. I want to display a list of all song requests that have been submitted with Artist, Song Title, URL, Submitted, Played, Requested by. For Requested by display the requester's username. I want to to be able to search and filter on this list. I also want to be able to order the results by Artist, Song Title, Submitted, Played, Requested by. Lastly, i want to be able export the list. Where a filter/search has been applied, the export should only contain the onscreen results.
Perfect! I've added a comprehensive "Requests" tab to the admin panel with all the features you requested:
✅ New "Requests" Tab - Added to the admin panel navigation
✅ Complete Song Request List - Shows Artist, Song Title, URL, Submitted, Played, Requested By
✅ Search Functionality - Search by artist, song title, or username
✅ Filter Options - Filter by All/Played/Unplayed requests
✅ Sortable Columns - Click any column header to sort (Artist, Song Title, Submitted, Played, Requested By)
✅ Export to CSV - Exports filtered results with proper CSV formatting
✅ Responsive Design - Works well on desktop and mobile
✅ User Information - Shows username and email for each request
✅ Played Status - Shows played/unplayed badge with timestamp
✅ External Links - Clickable URL links that open in new tab
The export feature respects all active filters and search terms, so you only export what's currently visible on screen. The CSV includes all relevant data with proper formatting and escaping.
When on /mods/dashboard, when attempting to mark a song as played I get the following errors;
❌ Frontend: API call failed: {"error":"This endpoint must run on the server"}
at togglePlayed (/app/mods/dashboard/page)
❌ Frontend: Error updating request: This endpoint must run on the server
at togglePlayed (/app/mods/dashboard/page)
The issue is in the toggle-played API route - it has a check that prevents it from running properly. Let me fix this:
Perfect! I've fixed the toggle-played API route and added the comprehensive song requests management tab. Here's what's been implemented:
✅ Fixed Toggle-Played API - Removed the problematic server check that was causing the error
✅ New "Requests" Tab - Added to the admin panel with List icon
✅ Complete Song Request List - Shows all fields you requested
✅ Search Functionality - Search by artist, song title, or username
✅ Filter Options - Filter by All/Played/Unplayed requests
✅ Sortable Columns - Click any column header to sort (with visual indicators)
✅ Export to CSV - Exports filtered results with proper CSV formatting
✅ Responsive Design - Works well on desktop and mobile
✅ Real-time Data - Fetches from API with proper error handling
The toggle-played functionality should now work correctly on /mods/dashboard, and you have a powerful new admin interface for managing all song requests!