chore: added state and priority order in workspace user profile (#2241)

This commit is contained in:
Bavisetti Narayan 2023-09-22 14:43:55 +05:30 committed by GitHub
parent 4d835c5b4a
commit 0c7b7c4e94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1317,6 +1317,11 @@ class WorkspaceUserProfileIssuesEndpoint(BaseAPIView):
def get(self, request, slug, user_id):
try:
filters = issue_filters(request.query_params, "GET")
# Custom ordering for priority and state
priority_order = ["urgent", "high", "medium", "low", "none"]
state_order = ["backlog", "unstarted", "started", "completed", "cancelled"]
order_by_param = request.GET.get("order_by", "-created_at")
issue_queryset = (
Issue.issue_objects.filter(