Skip to content

Commit

Permalink
fix: favourite cycle and modules displayed at top (#2719)
Browse files Browse the repository at this point in the history
  • Loading branch information
NarayanBavisetti authored Nov 9, 2023
1 parent 894ffb6 commit 630e21b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions apiserver/plane/api/views/cycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,8 @@ def get_queryset(self):
def list(self, request, slug, project_id):
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)
queryset = queryset.order_by("-is_favorite","-created_at")

# Current Cycle
if cycle_view == "current":
Expand Down
3 changes: 1 addition & 2 deletions apiserver/plane/api/views/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def get_serializer_class(self):
)

def get_queryset(self):
order_by = self.request.GET.get("order_by", "sort_order")

subquery = ModuleFavorite.objects.filter(
user=self.request.user,
Expand Down Expand Up @@ -138,7 +137,7 @@ def get_queryset(self):
),
)
)
.order_by(order_by, "name")
.order_by("-is_favorite","-created_at")
)

def create(self, request, slug, project_id):
Expand Down

0 comments on commit 630e21b

Please sign in to comment.