feat: created_by details for links (#313)

This commit is contained in:
pablohashescobar 2023-02-21 23:50:54 +05:30 committed by GitHub
parent 5cbb3ecd4d
commit 71f9ae41f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -461,6 +461,9 @@ class IssueModuleDetailSerializer(BaseSerializer):
class IssueLinkSerializer(BaseSerializer): class IssueLinkSerializer(BaseSerializer):
created_by_detail = UserLiteSerializer(read_only=True, source="created_by")
class Meta: class Meta:
model = IssueLink model = IssueLink
fields = "__all__" fields = "__all__"

View File

@ -138,7 +138,9 @@ class IssueViewSet(BaseViewSet):
.prefetch_related( .prefetch_related(
Prefetch( Prefetch(
"issue_link", "issue_link",
queryset=IssueLink.objects.select_related("issue"), queryset=IssueLink.objects.select_related("issue").select_related(
"created_by"
),
) )
) )
) )
@ -273,7 +275,9 @@ class UserWorkSpaceIssues(BaseAPIView):
.prefetch_related( .prefetch_related(
Prefetch( Prefetch(
"issue_link", "issue_link",
queryset=IssueLink.objects.select_related("issue"), queryset=IssueLink.objects.select_related(
"issue"
).select_related("created_by"),
) )
) )
) )