|
8 | 8 | """ |
9 | 9 |
|
10 | 10 | from django.utils.translation import gettext_lazy as _ |
| 11 | +from drf_yasg import openapi |
11 | 12 | from drf_yasg.utils import swagger_auto_schema |
12 | 13 | from rest_framework.decorators import action |
| 14 | +from rest_framework.parsers import MultiPartParser |
13 | 15 | from rest_framework.request import Request |
14 | 16 | from rest_framework.views import APIView |
15 | 17 |
|
@@ -448,11 +450,28 @@ def delete(self, request: Request, application_id: str, chat_id: str, chat_recor |
448 | 450 |
|
449 | 451 | class UploadFile(APIView): |
450 | 452 | authentication_classes = [TokenAuth] |
| 453 | + parser_classes = [MultiPartParser] |
451 | 454 |
|
452 | 455 | @action(methods=['POST'], detail=False) |
453 | 456 | @swagger_auto_schema(operation_summary=_("Upload files"), |
454 | 457 | operation_id=_("Upload files"), |
455 | | - manual_parameters=ChatRecordApi.get_request_params_api(), |
| 458 | + manual_parameters=[ |
| 459 | + openapi.Parameter(name='application_id', |
| 460 | + in_=openapi.IN_PATH, |
| 461 | + type=openapi.TYPE_STRING, |
| 462 | + required=True, |
| 463 | + description=_('Application ID')), |
| 464 | + openapi.Parameter(name='chat_id', |
| 465 | + in_=openapi.IN_PATH, |
| 466 | + type=openapi.TYPE_STRING, |
| 467 | + required=True, |
| 468 | + description=_('Conversation ID')), |
| 469 | + openapi.Parameter(name='file', |
| 470 | + in_=openapi.IN_FORM, |
| 471 | + type=openapi.TYPE_FILE, |
| 472 | + required=True, |
| 473 | + description=_('Upload file')) |
| 474 | + ], |
456 | 475 | tags=[_("Application/Conversation Log")] |
457 | 476 | ) |
458 | 477 | @has_permissions( |
|
0 commit comments