]> acesimba.cloud Git - codebuddy-web.git/commitdiff
fix: 修复任务删除接口 405(缺失 @app.delete 装饰器)
authorCodebuddy <codebuddy@localhost>
Fri, 18 Sep 2026 06:29:59 +0000 (14:29 +0800)
committerCodebuddy <codebuddy@localhost>
Fri, 18 Sep 2026 06:29:59 +0000 (14:29 +0800)
- api_delete_task 缺少 @app.delete("/api/tasks/{task_id}") 装饰器,
  导致 DELETE 路由从未注册,调用返回 405 Method Not Allowed,
  前端回退显示「删除失败」
- 补回装饰器,删除任务(含 24h 冷却、暂停校验等既有限制)恢复正常

backend/app.py

index 0a86c392644fb5ced70203feef207aea06771798..c4325f2509f010469102325d97b9963cc1690df3 100644 (file)
@@ -917,6 +917,7 @@ async def api_delete_url(url_id: str, request: Request):
 
 
 
+@app.delete("/api/tasks/{task_id}")
 async def api_delete_task(task_id: str, request: Request):
     if not _auth_ok(request):
         return JSONResponse({"ok": False, "error": "未授权"}, status_code=401)