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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user