paginate organization type
This commit is contained in:
@@ -213,8 +213,11 @@ class OrganizationTypeViewSet(SoftDeleteMixin, ModelViewSet):
|
||||
def list(self, request, *args, **kwargs):
|
||||
""" all organization type """
|
||||
queryset = self.get_queryset().order_by('-modify_date')
|
||||
serializer = self.serializer_class(queryset, many=True)
|
||||
return Response(serializer.data, status=status.HTTP_200_OK)
|
||||
page = self.paginate_queryset(queryset.order_by('-create_date')) # paginate queryset
|
||||
|
||||
if page is not None: # noqa
|
||||
serializer = self.serializer_class(page, many=True)
|
||||
return self.get_paginated_response(serializer.data)
|
||||
|
||||
|
||||
class OrganizationViewSet(BaseViewSet, SoftDeleteMixin, ModelViewSet, DynamicSearchMixin):
|
||||
|
||||
Reference in New Issue
Block a user