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