diff --git a/apiserver/plane/api/views/cycle.py b/apiserver/plane/api/views/cycle.py index 885199f83..a3d89fa81 100644 --- a/apiserver/plane/api/views/cycle.py +++ b/apiserver/plane/api/views/cycle.py @@ -165,6 +165,9 @@ class CycleViewSet(BaseViewSet): try: queryset = self.get_queryset() cycle_view = request.GET.get("cycle_view", "all") + order_by = request.GET.get("order_by", "sort_order") + + queryset = queryset.order_by(order_by) # All Cycles if cycle_view == "all": diff --git a/apiserver/plane/api/views/module.py b/apiserver/plane/api/views/module.py index 7d60456a0..1cd741f84 100644 --- a/apiserver/plane/api/views/module.py +++ b/apiserver/plane/api/views/module.py @@ -53,6 +53,8 @@ class ModuleViewSet(BaseViewSet): ) def get_queryset(self): + order_by = self.request.GET.get("order_by", "sort_order") + subquery = ModuleFavorite.objects.filter( user=self.request.user, module_id=OuterRef("pk"), @@ -106,7 +108,7 @@ class ModuleViewSet(BaseViewSet): filter=Q(issue_module__issue__state__group="backlog"), ) ) - .order_by("-is_favorite", "name") + .order_by(order_by, "name") ) def perform_destroy(self, instance):