From 5d806c87751e3cfa038688270aaf1b782a0628ad Mon Sep 17 00:00:00 2001 From: mortezaei Date: Wed, 21 May 2025 10:22:09 +0330 Subject: [PATCH] fix: search list courses --- apps/course/views/course.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/course/views/course.py b/apps/course/views/course.py index e0ada43..648d009 100644 --- a/apps/course/views/course.py +++ b/apps/course/views/course.py @@ -32,11 +32,16 @@ class CourseListAPIView(ListAPIView): queryset = Course.objects.all().exclude(status=Course.StatusChoices.INACTIVE) serializer_class = CourseListSerializer filter_backends = [SearchFilter] - search_fields = ['title'] + search_fields = ['title', 'category__name', 'professor__fullname'] @swagger_auto_schema( operation_description=doc_course_list(), manual_parameters=[ + openapi.Parameter( + 'search', openapi.IN_QUERY, + description="Search by course title, category name, or professor's full name", + type=openapi.TYPE_STRING, + ), openapi.Parameter( 'category_slug', openapi.IN_QUERY, description="Category of the Course",