diff --git a/market/viewsets.py b/market/viewsets.py index 51efb8e..dd016da 100644 --- a/market/viewsets.py +++ b/market/viewsets.py @@ -33,6 +33,11 @@ class ProductViewset(ActionBasedMixin, ModelViewSet): } permission_classes = [IsAdminUserOrReadOnly] + def list(self, request, *args, **kwargs): + queryset = self.filter_queryset(self.get_queryset()) + serializer = self.get_serializer(queryset, many=True) + return Response(serializer.data) + @action(detail=True, methods=["GET"]) def posts(self, request, pk): product = self.get_object()