forked from github/plane
fix: favourite cycle and modules displayed at top (#2719)
This commit is contained in:
parent
894ffb6c21
commit
630e21b954
@ -176,9 +176,8 @@ class CycleViewSet(BaseViewSet):
|
||||
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":
|
||||
|
@ -55,7 +55,6 @@ 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,
|
||||
@ -138,7 +137,7 @@ class ModuleViewSet(BaseViewSet):
|
||||
),
|
||||
)
|
||||
)
|
||||
.order_by(order_by, "name")
|
||||
.order_by("-is_favorite","-created_at")
|
||||
)
|
||||
|
||||
def create(self, request, slug, project_id):
|
||||
|
Loading…
Reference in New Issue
Block a user