diff --git a/todo/views/task.py b/todo/views/task.py index b409cd8..823b488 100644 --- a/todo/views/task.py +++ b/todo/views/task.py @@ -3,10 +3,14 @@ from rest_framework import status from rest_framework.request import Request from todo.serializers.get_tasks_serializer import GetTaskQueryParamsSerializer +from todo.services.task_service import TaskService class TaskView(APIView): def get(self, request: Request): query = GetTaskQueryParamsSerializer(data=request.query_params) query.is_valid(raise_exception=True) - return Response({}, status.HTTP_200_OK) + page = query.validated_data["page"] + limit = query.validated_data["limit"] + response = TaskService.get_tasks(page, limit) + return Response(response.model_dump(mode="json", exclude_none=True), status.HTTP_200_OK)