Skip to content
Snippets Groups Projects
Verified Commit f9fa47b8 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

feat: filter list of playlists by showId

parent 4ace181d
No related branches found
No related tags found
1 merge request!59Add playlists
......@@ -1647,3 +1647,13 @@ class APIPlaylistViewSet(viewsets.ModelViewSet):
return Playlist.objects.none()
return Playlist.objects.all()
def list(self, request, *args, **kwargs):
if show_id := request.query_params.get("show_id"):
queryset = self.get_queryset().filter(show_id=int(show_id))
else:
queryset = self.get_queryset()
serializer = PlaylistSerializer(queryset, many=True)
return Response(serializer.data)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment