feat: delete AI reports, Super Contexte versions, and KB entries

- database.py: add delete_ai_report(), delete_reasoning_state(), delete_kb_entry()
- reasoning.py: DELETE /api/reasoning/reports/{id}
- knowledge.py: DELETE /api/knowledge/history/{id} and /entries/{id}
- useApi.ts: useDeleteAiReport, useDeleteReasoningState, useDeleteKbEntry hooks
- RapportIA.tsx: trash icon on hover in archived reports sidebar
- SuperContexte.tsx: trash icon on hover for history versions and KB entries;
  both propagate onDelete through CategorySection down to KbEntry

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OpenSquared
2026-06-17 00:10:41 +02:00
parent 22687dfd03
commit a3fb486477
6 changed files with 174 additions and 33 deletions

View File

@@ -1451,3 +1451,27 @@ def get_reasoning_state_by_id(state_id: int) -> Optional[Dict[str, Any]]:
except Exception:
d["synthesis"] = {}
return d
def delete_ai_report(report_id: int) -> bool:
conn = get_conn()
cur = conn.execute("DELETE FROM ai_reports WHERE id=?", (report_id,))
conn.commit()
conn.close()
return cur.rowcount > 0
def delete_reasoning_state(state_id: int) -> bool:
conn = get_conn()
cur = conn.execute("DELETE FROM reasoning_state WHERE id=?", (state_id,))
conn.commit()
conn.close()
return cur.rowcount > 0
def delete_kb_entry(entry_id: int) -> bool:
conn = get_conn()
cur = conn.execute("DELETE FROM knowledge_base WHERE id=?", (entry_id,))
conn.commit()
conn.close()
return cur.rowcount > 0