From 678eae2c5fe37b58d36275e3ea8db2d34efbdce8 Mon Sep 17 00:00:00 2001 From: jhynsoo Date: Mon, 16 Oct 2023 22:53:14 +0900 Subject: [PATCH] fix: Prevent paginate for product list --- market/viewsets.py | 5 +++++ 1 file changed, 5 insertions(+) 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()