diff --git a/backend/chat/views.py b/backend/chat/views.py index 3bc017f..e9b212c 100644 --- a/backend/chat/views.py +++ b/backend/chat/views.py @@ -73,22 +73,6 @@ class StructurePagination(LimitOffsetPagination): post=extend_schema( summary="Send a new message in the product chat", request=NewMessageSerializer, - parameters=[ - OpenApiParameter( - name="limit", - description="Number of results to return per page.", - required=False, - type=int, - default=10, - ), - OpenApiParameter( - name="offset", - description="The starting position of the results.", - required=False, - type=int, - default=0, - ), - ], responses={ 200: OpenApiExample( "Message sent successfully", @@ -130,10 +114,8 @@ class ProductChatView(APIView): sender = 'user' if message.role == 'user' else 'ai' formatted_messages.append({'sender': sender, 'content': content.text.value, 'id': counter}) counter += 1 - - paginator = StructurePagination() - paginated_messages = paginator.paginate_queryset(formatted_messages, request) - return paginator.get_paginated_response(paginated_messages) + formatted_messages = formatted_messages[-2:] + return Response(formatted_messages, status=status.HTTP_201_CREATED) def post(self, request, pk): """