forked from github/plane
chore: total members in user workspace invites (#1143)
This commit is contained in:
parent
bc8430220b
commit
c9dee593eb
@ -44,6 +44,7 @@ class WorkSpaceMemberSerializer(BaseSerializer):
|
|||||||
|
|
||||||
class WorkSpaceMemberInviteSerializer(BaseSerializer):
|
class WorkSpaceMemberInviteSerializer(BaseSerializer):
|
||||||
workspace = WorkSpaceSerializer(read_only=True)
|
workspace = WorkSpaceSerializer(read_only=True)
|
||||||
|
total_members = serializers.IntegerField(read_only=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = WorkspaceMemberInvite
|
model = WorkspaceMemberInvite
|
||||||
|
@ -375,6 +375,7 @@ class UserWorkspaceInvitationsEndpoint(BaseViewSet):
|
|||||||
.get_queryset()
|
.get_queryset()
|
||||||
.filter(email=self.request.user.email)
|
.filter(email=self.request.user.email)
|
||||||
.select_related("workspace", "workspace__owner")
|
.select_related("workspace", "workspace__owner")
|
||||||
|
.annotate(total_members=Count("workspace__workspace_member"))
|
||||||
)
|
)
|
||||||
|
|
||||||
def create(self, request):
|
def create(self, request):
|
||||||
|
Loading…
Reference in New Issue
Block a user