From d5477a1e1a3f8fca14ccd194fd9d20741ea832e6 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Mon, 6 Jan 2025 14:27:39 +0800 Subject: [PATCH] Fix head document requests endpoint --- docmanager_backend/document_requests/serializers.py | 2 +- docmanager_backend/document_requests/views.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docmanager_backend/document_requests/serializers.py b/docmanager_backend/document_requests/serializers.py index 9b3f770..23d065c 100644 --- a/docmanager_backend/document_requests/serializers.py +++ b/docmanager_backend/document_requests/serializers.py @@ -124,7 +124,7 @@ class DocumentRequestSerializer(serializers.ModelSerializer): class FullDocumentRequestSerializer(serializers.ModelSerializer): - documents = DocumentRequestUnitWithFileSerializer() + documents = DocumentRequestUnitWithFileSerializer(many=True) requester = serializers.SlugRelatedField( many=False, slug_field="full_name", diff --git a/docmanager_backend/document_requests/views.py b/docmanager_backend/document_requests/views.py index b604dbd..b056e5a 100644 --- a/docmanager_backend/document_requests/views.py +++ b/docmanager_backend/document_requests/views.py @@ -7,6 +7,7 @@ from .serializers import ( DocumentRequestCreationSerializer, DocumentRequestSerializer, DocumentRequestUpdateSerializer, + FullDocumentRequestSerializer ) from .models import DocumentRequest @@ -49,7 +50,7 @@ class DocumentRequestFullListView(generics.ListAPIView): """ http_method_names = ["get"] - serializer_class = DocumentRequestSerializer + serializer_class = FullDocumentRequestSerializer pagination_class = PageNumberPagination permission_classes = [IsAuthenticated, IsStaff] queryset = DocumentRequest.objects.all()