[WEB - 1740] chore: add issue id in pages detail endpoint (#4942)

* chore: add issue id in pages detail endpoint

* fix: response structure changed

---------

Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
This commit is contained in:
Nikhil
2024-07-05 15:00:15 +05:30
committed by GitHub
parent 977b47d35f
commit 61ce055cb3
2 changed files with 10 additions and 2 deletions

View File

@@ -215,8 +215,14 @@ class PageViewSet(BaseViewSet):
status=status.HTTP_404_NOT_FOUND,
)
else:
issue_ids = PageLog.objects.filter(
page_id=pk, entity_name="issue"
).values_list("entity_identifier", flat=True)
data = PageDetailSerializer(page).data
data["issue_ids"] = issue_ids
return Response(
PageDetailSerializer(page).data, status=status.HTTP_200_OK
data,
status=status.HTTP_200_OK,
)
def lock(self, request, slug, project_id, pk):

View File

@@ -93,7 +93,9 @@ class PageLog(BaseModel):
verbose_name="Transaction Type",
)
workspace = models.ForeignKey(
"db.Workspace", on_delete=models.CASCADE, related_name="workspace_page_log"
"db.Workspace",
on_delete=models.CASCADE,
related_name="workspace_page_log",
)
class Meta: