chore: add cycle id and module id in issues list endpoint (#586)

This commit is contained in:
pablohashescobar 2023-03-30 01:25:16 +05:30 committed by GitHub
parent d7ed237f78
commit 7eaec16381
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -486,6 +486,8 @@ class IssueLiteSerializer(BaseSerializer):
label_details = LabelLiteSerializer(read_only=True, source="labels", many=True)
assignee_details = UserLiteSerializer(read_only=True, source="assignees", many=True)
sub_issues_count = serializers.IntegerField(read_only=True)
cycle_id = serializers.UUIDField(read_only=True)
module_id = serializers.UUIDField(read_only=True)
class Meta:
model = Issue

View File

@ -150,6 +150,8 @@ class IssueViewSet(BaseViewSet):
self.get_queryset()
.order_by(request.GET.get("order_by", "created_at"))
.filter(**filters)
.annotate(cycle_id=F("issue_cycle__id"))
.annotate(module_id=F("issue_module__id"))
)
issue_queryset = (