add delete comment and reply

This commit is contained in:
hjlarry
2025-08-31 00:28:01 +08:00
parent d4a6acbd99
commit 816bdf0320
2 changed files with 45 additions and 38 deletions

View File

@ -118,7 +118,7 @@ class WorkflowCommentDetailApi(Resource):
user_id=current_user.id,
)
return {"message": "Comment deleted successfully"}, 200
return {"result": "success"}, 204
class WorkflowCommentResolveApi(Resource):
@ -140,22 +140,6 @@ class WorkflowCommentResolveApi(Resource):
return comment
@login_required
@setup_required
@account_initialization_required
@get_app_model
@marshal_with(workflow_comment_resolve_fields)
def delete(self, app_model: App, comment_id: str):
"""Reopen a resolved workflow comment."""
comment = WorkflowCommentService.reopen_comment(
tenant_id=current_user.current_tenant_id,
app_id=app_model.id,
comment_id=comment_id,
user_id=current_user.id,
)
return comment
class WorkflowCommentReplyApi(Resource):
"""API for managing comment replies."""
@ -229,7 +213,7 @@ class WorkflowCommentReplyDetailApi(Resource):
WorkflowCommentService.delete_reply(reply_id=reply_id, user_id=current_user.id)
return {"message": "Reply deleted successfully"}, 200
return {"result": "success"}, 204
# Register API routes