diff --git a/apiserver/plane/api/serializers/issue.py b/apiserver/plane/api/serializers/issue.py index 95c3f5827..6a3c06e22 100644 --- a/apiserver/plane/api/serializers/issue.py +++ b/apiserver/plane/api/serializers/issue.py @@ -50,16 +50,6 @@ class IssueFlatSerializer(BaseSerializer): ] -# Issue Serializer with state details -class IssueStateSerializer(BaseSerializer): - state_detail = StateSerializer(read_only=True, source="state") - project_detail = ProjectSerializer(read_only=True, source="project") - - class Meta: - model = Issue - fields = "__all__" - - ##TODO: Find a better way to write this serializer ## Find a better approach to save manytomany? class IssueCreateSerializer(BaseSerializer): @@ -461,7 +451,6 @@ class IssueModuleDetailSerializer(BaseSerializer): class IssueLinkSerializer(BaseSerializer): - created_by_detail = UserLiteSerializer(read_only=True, source="created_by") class Meta: @@ -469,6 +458,18 @@ class IssueLinkSerializer(BaseSerializer): fields = "__all__" +# Issue Serializer with state details +class IssueStateSerializer(BaseSerializer): + state_detail = StateSerializer(read_only=True, source="state") + project_detail = ProjectSerializer(read_only=True, source="project") + label_details = LabelSerializer(read_only=True, source="labels", many=True) + assignee_details = UserLiteSerializer(read_only=True, source="assignees", many=True) + + class Meta: + model = Issue + fields = "__all__" + + class IssueSerializer(BaseSerializer): project_detail = ProjectSerializer(read_only=True, source="project") state_detail = StateSerializer(read_only=True, source="state")