From 23e3aa3dd9289677c0195bc2646968e24441b106 Mon Sep 17 00:00:00 2001 From: NarayanBavisetti Date: Thu, 16 Nov 2023 18:37:33 +0530 Subject: [PATCH] fix: removed duplicate code --- apiserver/plane/api/views/page.py | 39 ------------------------------- 1 file changed, 39 deletions(-) diff --git a/apiserver/plane/api/views/page.py b/apiserver/plane/api/views/page.py index 2ee4a03d9..a4ebc2f69 100644 --- a/apiserver/plane/api/views/page.py +++ b/apiserver/plane/api/views/page.py @@ -277,45 +277,6 @@ class PageViewSet(BaseViewSet): PageSerializer(pages, many=True).data, status=status.HTTP_200_OK ) - unarchive_archive_page_and_descendants(page_id, datetime.now()) - - return Response(status=status.HTTP_204_NO_CONTENT) - - def unarchive(self, request, slug, project_id, page_id): - page = Page.objects.get( - project_id=project_id, - owned_by_id=request.user.id, - workspace__slug=slug, - pk=page_id, - ) - - page.parent = None - page.save() - - unarchive_archive_page_and_descendants(page_id, None) - - return Response(status=status.HTTP_204_NO_CONTENT) - - def archive_list(self, request, slug, project_id): - pages = ( - Page.objects.filter( - project_id=project_id, - workspace__slug=slug, - ) - .filter(archived_at__isnull=False) - .filter(parent_id__isnull=True) - ) - - if not pages: - return Response( - {"error": "No pages found"}, status=status.HTTP_400_BAD_REQUEST - ) - - return Response( - PageSerializer(pages, many=True).data, status=status.HTTP_200_OK - ) - - class PageFavoriteViewSet(BaseViewSet): permission_classes = [