fix: blackboard_routes mention_queue linkage (missed by auto-sync)
This commit is contained in:
@@ -261,9 +261,24 @@ async def get_comments(project_id: str, task_id: str,
|
||||
@router.post("/tasks/{task_id}/comments")
|
||||
async def add_comment(project_id: str, task_id: str, body: Dict[str, Any]):
|
||||
bb = _bb(project_id)
|
||||
mentions_raw = body.get("mentions")
|
||||
cid = bb.add_comment(task_id, body["author"], body["body"],
|
||||
comment_type=body.get("comment_type", "general"),
|
||||
mentions=body.get("mentions"))
|
||||
mentions=mentions_raw)
|
||||
# v2.9 #01: 写入 mention_queue
|
||||
if mentions_raw:
|
||||
if isinstance(mentions_raw, str):
|
||||
import json as _json
|
||||
try:
|
||||
mentions_list = _json.loads(mentions_raw)
|
||||
except Exception:
|
||||
mentions_list = []
|
||||
elif isinstance(mentions_raw, list):
|
||||
mentions_list = mentions_raw
|
||||
else:
|
||||
mentions_list = []
|
||||
if mentions_list:
|
||||
bb.record_mentions(cid, task_id, mentions_list)
|
||||
return {"ok": True, "comment_id": cid}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user