add: add filter to income-expence contract list api
This commit is contained in:
@@ -43,6 +43,10 @@ class ExpenceContractListApiView(generics.GenericAPIView):
|
||||
permission_classes = [HasRolePermission]
|
||||
|
||||
def get(self, request):
|
||||
counterparty_id = request.query_params.get('counterparty')
|
||||
if counterparty_id:
|
||||
self.queryset = self.queryset.filter(counterparty=counterparty_id)
|
||||
|
||||
page = self.paginate_queryset(self.queryset)
|
||||
if page is not None:
|
||||
serializer = self.serializer_class(page, many=True)
|
||||
|
||||
@@ -44,6 +44,10 @@ class IncomeContractListApiView(generics.GenericAPIView):
|
||||
permission_classes = [HasRolePermission]
|
||||
|
||||
def get(self, request):
|
||||
counterparty_id = request.query_params.get('counterparty')
|
||||
if counterparty_id:
|
||||
self.queryset = self.queryset.filter(counterparty=counterparty_id)
|
||||
|
||||
page = self.paginate_queryset(self.queryset)
|
||||
if page is not None:
|
||||
serializer = self.serializer_class(page, many=True)
|
||||
|
||||
Reference in New Issue
Block a user