mirror of
https://github.com/makeplane/plane.git
synced 2025-12-25 08:09:33 +01:00
fix: changed the response structure (#6301)
This commit is contained in:
committed by
GitHub
parent
61d6d928ba
commit
5e6c02358d
@@ -572,6 +572,7 @@ class PageDuplicateEndpoint(BaseAPIView):
|
||||
page.pk = None
|
||||
page.name = f"{page.name} (Copy)"
|
||||
page.description_binary = None
|
||||
page.owned_by = request.user
|
||||
page.save()
|
||||
|
||||
for project_id in project_ids:
|
||||
@@ -586,6 +587,17 @@ class PageDuplicateEndpoint(BaseAPIView):
|
||||
page_transaction.delay(
|
||||
{"description_html": page.description_html}, None, page.id
|
||||
)
|
||||
page = Page.objects.get(pk=page.id)
|
||||
page = (
|
||||
Page.objects.filter(pk=page.id)
|
||||
.annotate(
|
||||
project_ids=Coalesce(
|
||||
ArrayAgg(
|
||||
"projects__id", distinct=True, filter=~Q(projects__id=True)
|
||||
),
|
||||
Value([], output_field=ArrayField(UUIDField())),
|
||||
)
|
||||
)
|
||||
.first()
|
||||
)
|
||||
serializer = PageDetailSerializer(page)
|
||||
return Response(serializer.data, status=status.HTTP_201_CREATED)
|
||||
|
||||
Reference in New Issue
Block a user