diff --git a/apiserver/plane/api/views/project.py b/apiserver/plane/api/views/project.py index 2510c4ade..721212105 100644 --- a/apiserver/plane/api/views/project.py +++ b/apiserver/plane/api/views/project.py @@ -91,6 +91,24 @@ class ProjectViewSet(BaseViewSet): ) ) ) + .annotate( + total_members=ProjectMember.objects.filter(project_id=OuterRef("id")) + .order_by() + .annotate(count=Func(F("id"), function="Count")) + .values("count") + ) + .annotate( + total_cycles=Cycle.objects.filter(project_id=OuterRef("id")) + .order_by() + .annotate(count=Func(F("id"), function="Count")) + .values("count") + ) + .annotate( + total_modules=Module.objects.filter(project_id=OuterRef("id")) + .order_by() + .annotate(count=Func(F("id"), function="Count")) + .values("count") + ) .distinct() )