From a5558f8fcc3cdfbfd12aad1aafa14ac4e362a892 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Thu, 7 Nov 2024 18:07:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(conversation-service):=20return=20success?= =?UTF-8?q?=20response=20after=20conversation=E2=80=A6=20(#10416)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/controllers/service_api/app/conversation.py | 3 +-- api/services/conversation_service.py | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/api/controllers/service_api/app/conversation.py b/api/controllers/service_api/app/conversation.py index 527ef4ecd3..a0bd1b7412 100644 --- a/api/controllers/service_api/app/conversation.py +++ b/api/controllers/service_api/app/conversation.py @@ -58,10 +58,9 @@ class ConversationDetailApi(Resource): conversation_id = str(c_id) try: - ConversationService.delete(app_model, conversation_id, end_user) + return ConversationService.delete(app_model, conversation_id, end_user) except services.errors.conversation.ConversationNotExistsError: raise NotFound("Conversation Not Exists.") - return {"result": "success"}, 200 class ConversationRenameApi(Resource): diff --git a/api/services/conversation_service.py b/api/services/conversation_service.py index 7bfe59afa0..ac9f577c32 100644 --- a/api/services/conversation_service.py +++ b/api/services/conversation_service.py @@ -160,4 +160,7 @@ class ConversationService: conversation = cls.get_conversation(app_model, conversation_id, user) conversation.is_deleted = True + conversation.updated_at = datetime.now(timezone.utc).replace(tzinfo=None) db.session.commit() + + return {"result": "success"}, 200