fix(co-gahusb): update_task 존재하지 않는 task_id not_found 가드
This commit is contained in:
@@ -106,6 +106,8 @@ async def update_task(r, task_id, status, role, note=None):
|
||||
if status not in VALID_STATUS:
|
||||
raise ValueError(f"invalid status: {status}")
|
||||
key = TASK_PREFIX + str(task_id)
|
||||
if not await r.exists(key):
|
||||
return {"ok": False, "error": "not_found"}
|
||||
mapping = {"status": status}
|
||||
if note is not None:
|
||||
mapping["note"] = note
|
||||
|
||||
Reference in New Issue
Block a user