Add missing DELETE /api/kanban/tasks/{id} endpoint
The Kanban detail modal's Delete button called api.deleteKanbanTask(), which didn't exist on the client, and there was no backend route for it either - clicking Delete just threw 'api.deleteKanbanTask is not a function'. Add both the client method and the backend endpoint.
This commit is contained in:
parent
9e632ab1dc
commit
2a5f0aee74
|
|
@ -55,6 +55,7 @@ const api = {
|
|||
// Kanban
|
||||
getKanbanBoard: (status) => api.get(status ? `/api/kanban/board?status=${encodeURIComponent(status)}` : '/api/kanban/board'),
|
||||
getKanbanTask: (id) => api.get(`/api/kanban/tasks/${encodeURIComponent(id)}`),
|
||||
deleteKanbanTask: (id) => api.del(`/api/kanban/tasks/${encodeURIComponent(id)}`),
|
||||
createKanbanTask: (data) => api.post('/api/kanban/tasks', data),
|
||||
updateKanbanTask: (id, data) => api.patch(`/api/kanban/tasks/${encodeURIComponent(id)}`, data),
|
||||
completeKanbanTask: (id, summary) => api.post(`/api/kanban/tasks/${encodeURIComponent(id)}/complete`, { summary }),
|
||||
|
|
|
|||
|
|
@ -947,6 +947,15 @@ def kanban_get_task(task_id: str):
|
|||
raise HTTPException(404, "Task not found")
|
||||
return json.loads(path.read_text())
|
||||
|
||||
@app.delete("/api/kanban/tasks/{task_id}")
|
||||
def kanban_delete_task(task_id: str):
|
||||
path = kanban_task_path(task_id)
|
||||
if not path.exists():
|
||||
raise HTTPException(404, "Task not found")
|
||||
path.unlink()
|
||||
append_audit({"action": "kanban_task_deleted", "task_id": task_id})
|
||||
return {"status": "deleted", "task_id": task_id}
|
||||
|
||||
@app.post("/api/kanban/tasks")
|
||||
def kanban_create_task(data: KanbanTaskCreate):
|
||||
try:
|
||||
|
|
|
|||
Loading…
Reference in New Issue