fix: change HTTP methods from GET to PUT for disassociation and related questions endpoints

This commit is contained in:
CaptainB 2025-05-12 16:24:01 +08:00
parent a5fb2e15c6
commit 6f81d80389

View File

@ -207,7 +207,7 @@ class ParagraphView(APIView):
authentication_classes = [TokenAuth]
@extend_schema(
methods=['GET'],
methods=['PUT'],
summary=_('Disassociation issue'),
description=_('Disassociation issue'),
operation_id=_('Disassociation issue'), # type: ignore
@ -216,7 +216,7 @@ class ParagraphView(APIView):
tags=[_('Knowledge Base/Documentation/Paragraph')] # type: ignore
)
@has_permissions(PermissionConstants.DOCUMENT_EDIT.get_workspace_permission())
def get(self, request: Request,
def put(self, request: Request,
workspace_id: str, knowledge_id: str, document_id: str, paragraph_id: str, problem_id: str):
return result.success(ParagraphSerializers.Association(
data={
@ -232,7 +232,7 @@ class ParagraphView(APIView):
authentication_classes = [TokenAuth]
@extend_schema(
methods=['GET'],
methods=['PUT'],
summary=_('Related questions'),
description=_('Related questions'),
operation_id=_('Related questions'), # type: ignore
@ -241,7 +241,7 @@ class ParagraphView(APIView):
tags=[_('Knowledge Base/Documentation/Paragraph')] # type: ignore
)
@has_permissions(PermissionConstants.DOCUMENT_EDIT.get_workspace_permission())
def get(self, request: Request,
def put(self, request: Request,
workspace_id: str, knowledge_id: str, document_id: str, paragraph_id: str, problem_id: str):
return result.success(ParagraphSerializers.Association(
data={