fix: Prevent paginate for product list

This commit is contained in:
jhynsoo 2023-10-16 22:53:14 +09:00
parent b81b18ed12
commit 678eae2c5f

View File

@ -33,6 +33,11 @@ class ProductViewset(ActionBasedMixin, ModelViewSet):
} }
permission_classes = [IsAdminUserOrReadOnly] 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"]) @action(detail=True, methods=["GET"])
def posts(self, request, pk): def posts(self, request, pk):
product = self.get_object() product = self.get_object()