Skip to content

Commit

Permalink
Merge branch 'feature/list-flows-by-project-uuid' of https://github.c…
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaslinhares committed Apr 4, 2024
2 parents 1348407 + 0e76ff3 commit 8e6153f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions weni/internal/flows/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
from temba.flows.models import Flow


class FlowPagination(PageNumberPagination):
page_size_query_param = 'page_size'
max_page_size = 20


class FlowViewSet(CreateModelMixin, InternalGenericViewSet, ListModelMixin):
serializer_class = FlowSerializer
pagination_class = PageNumberPagination
pagination_class = FlowPagination

def get_queryset(self):
serializer = self.get_serializer(data=self.request.query_params.dict())
Expand All @@ -22,7 +27,7 @@ def get_queryset(self):
).exclude(is_archived=True)

if queryset:
return self.paginate_queryset(queryset)
return queryset

raise NotFound()

Expand Down

0 comments on commit 8e6153f

Please sign in to comment.