chore: snoozed inbox issue (#4487)

This commit is contained in:
Bavisetti Narayan 2024-05-17 18:19:17 +05:30 committed by GitHub
parent 564625ee22
commit fc31186aec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -467,12 +467,7 @@ class InboxIssueViewSet(BaseViewSet):
) )
inbox_issue = ( inbox_issue = (
InboxIssue.objects.filter( InboxIssue.objects.select_related("issue")
inbox_id=inbox_id.id,
issue_id=serializer.data["id"],
project_id=project_id,
)
.select_related("issue")
.prefetch_related( .prefetch_related(
"issue__labels", "issue__labels",
"issue__assignees", "issue__assignees",
@ -484,10 +479,7 @@ class InboxIssueViewSet(BaseViewSet):
distinct=True, distinct=True,
filter=~Q(issue__labels__id__isnull=True), filter=~Q(issue__labels__id__isnull=True),
), ),
Value( Value([], output_field=ArrayField(UUIDField())),
[],
output_field=ArrayField(UUIDField()),
),
), ),
assignee_ids=Coalesce( assignee_ids=Coalesce(
ArrayAgg( ArrayAgg(
@ -495,13 +487,14 @@ class InboxIssueViewSet(BaseViewSet):
distinct=True, distinct=True,
filter=~Q(issue__assignees__id__isnull=True), filter=~Q(issue__assignees__id__isnull=True),
), ),
Value( Value([], output_field=ArrayField(UUIDField())),
[],
output_field=ArrayField(UUIDField()),
),
), ),
) )
.first() .get(
inbox_id=inbox_id.id,
issue_id=issue_id,
project_id=project_id,
)
) )
serializer = InboxIssueDetailSerializer(inbox_issue).data serializer = InboxIssueDetailSerializer(inbox_issue).data
return Response(serializer, status=status.HTTP_200_OK) return Response(serializer, status=status.HTTP_200_OK)