From b60165aa4253677694c9b890e8b3d25c56a4ecc1 Mon Sep 17 00:00:00 2001 From: Mojtaba-z Date: Wed, 9 Jul 2025 15:12:30 +0330 Subject: [PATCH] paginate active plans --- apps/product/web/api/v1/viewsets/product_api.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/product/web/api/v1/viewsets/product_api.py b/apps/product/web/api/v1/viewsets/product_api.py index f74cc75..b1e420f 100644 --- a/apps/product/web/api/v1/viewsets/product_api.py +++ b/apps/product/web/api/v1/viewsets/product_api.py @@ -314,6 +314,11 @@ class IncentivePlanViewSet(viewsets.ModelViewSet): # noqa Q(start_date_limit__lte=today, end_date_limit__gte=today) ) + page = self.paginate_queryset(incentive_plans) + if page is not None: + serializer = self.get_serializer(page, many=True) + return self.get_paginated_response(serializer.data) + serializer = self.serializer_class(incentive_plans, many=True) return Response(serializer.data, status=status.HTTP_200_OK)