diff --git a/core/apps/counterparty/urls.py b/core/apps/counterparty/urls.py index c095561..09fba52 100644 --- a/core/apps/counterparty/urls.py +++ b/core/apps/counterparty/urls.py @@ -10,6 +10,7 @@ urlpatterns = [ path('list/', cp_views.CounterpartyListApiView.as_view()), path('create/', cp_views.CounterpartyCreateApiView.as_view()), path('/archive/', cp_views.ArchiveCounterpartyApiView.as_view()), + path('archived/list/', cp_views.ArchivedCounterpartyListApiView.as_view()), ] )), path('counterparty_folder/', include( diff --git a/core/apps/counterparty/views/counterparty.py b/core/apps/counterparty/views/counterparty.py index 6225949..7f06fe5 100644 --- a/core/apps/counterparty/views/counterparty.py +++ b/core/apps/counterparty/views/counterparty.py @@ -48,4 +48,12 @@ class ArchiveCounterpartyApiView(views.APIView): return Response( {'success': True, 'message': 'counterparty archived'}, status=200 - ) \ No newline at end of file + ) + + +class ArchivedCounterpartyListApiView(generics.ListAPIView): + serializer_class = serializers.CounterpartyListSerializer + queryset = Counterparty.objects.exclude(is_archived=False) + pagination_class = [HasRolePermission] + required_permissions = [] + pagination_class = CustomPageNumberPagination \ No newline at end of file