Add delete session functionality

- DELETE /api/v1/sessions/{id}: only closed sessions, user-scoped
- Returns 404 if not found/wrong user, 409 if session still open
- Deletes session_logs first, then session (no CASCADE)
- Frontend: trash button per session in SessionList (closed sessions only)
- Confirm dialog before delete, toast feedback, list reloads after

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Christoph K.
2026-03-23 20:50:48 +01:00
parent 6d7d353ea2
commit 833ad04a6f
6 changed files with 147 additions and 27 deletions

View File

@@ -42,6 +42,7 @@ func (h *Handler) RegisterRoutes(mux *http.ServeMux) {
mux.HandleFunc("GET /api/v1/sessions", h.handleListSessions)
mux.HandleFunc("GET /api/v1/sessions/{id}", h.handleGetSession)
mux.HandleFunc("PUT /api/v1/sessions/{id}/end", h.handleEndSession)
mux.HandleFunc("DELETE /api/v1/sessions/{id}", h.handleDeleteSession)
// Session Logs
mux.HandleFunc("POST /api/v1/sessions/{id}/logs", h.handleCreateLog)