fix(conversation-service): return success response after conversation… (#10416)

pull/10421/head
Benjamin 1 year ago committed by GitHub
parent 823ae03a08
commit a5558f8fcc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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):

@ -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

Loading…
Cancel
Save