chore: total issue count

This commit is contained in:
NarayanBavisetti 2024-05-01 12:52:46 +05:30
parent 12b4f74e1d
commit 5436b489ab

View File

@ -185,7 +185,6 @@ class ProjectViewSet(WebhookMixin, BaseViewSet):
.annotate( .annotate(
total_issues=Issue.issue_objects.filter( total_issues=Issue.issue_objects.filter(
project_id=self.kwargs.get("pk"), project_id=self.kwargs.get("pk"),
parent__isnull=True,
) )
.order_by() .order_by()
.annotate(count=Func(F("id"), function="Count")) .annotate(count=Func(F("id"), function="Count"))
@ -194,7 +193,6 @@ class ProjectViewSet(WebhookMixin, BaseViewSet):
.annotate( .annotate(
sub_issues=Issue.issue_objects.filter( sub_issues=Issue.issue_objects.filter(
project_id=self.kwargs.get("pk"), project_id=self.kwargs.get("pk"),
parent__isnull=False,
) )
.order_by() .order_by()
.annotate(count=Func(F("id"), function="Count")) .annotate(count=Func(F("id"), function="Count"))
@ -204,7 +202,6 @@ class ProjectViewSet(WebhookMixin, BaseViewSet):
archived_issues=Issue.objects.filter( archived_issues=Issue.objects.filter(
project_id=self.kwargs.get("pk"), project_id=self.kwargs.get("pk"),
archived_at__isnull=False, archived_at__isnull=False,
parent__isnull=True,
) )
.order_by() .order_by()
.annotate(count=Func(F("id"), function="Count")) .annotate(count=Func(F("id"), function="Count"))
@ -214,7 +211,6 @@ class ProjectViewSet(WebhookMixin, BaseViewSet):
archived_sub_issues=Issue.objects.filter( archived_sub_issues=Issue.objects.filter(
project_id=self.kwargs.get("pk"), project_id=self.kwargs.get("pk"),
archived_at__isnull=False, archived_at__isnull=False,
parent__isnull=False,
) )
.order_by() .order_by()
.annotate(count=Func(F("id"), function="Count")) .annotate(count=Func(F("id"), function="Count"))
@ -224,7 +220,6 @@ class ProjectViewSet(WebhookMixin, BaseViewSet):
draft_issues=Issue.objects.filter( draft_issues=Issue.objects.filter(
project_id=self.kwargs.get("pk"), project_id=self.kwargs.get("pk"),
is_draft=True, is_draft=True,
parent__isnull=True,
) )
.order_by() .order_by()
.annotate(count=Func(F("id"), function="Count")) .annotate(count=Func(F("id"), function="Count"))
@ -234,7 +229,6 @@ class ProjectViewSet(WebhookMixin, BaseViewSet):
draft_sub_issues=Issue.objects.filter( draft_sub_issues=Issue.objects.filter(
project_id=self.kwargs.get("pk"), project_id=self.kwargs.get("pk"),
is_draft=True, is_draft=True,
parent__isnull=False,
) )
.order_by() .order_by()
.annotate(count=Func(F("id"), function="Count")) .annotate(count=Func(F("id"), function="Count"))