From 7e9395ed6c3ea56caff91414636d8a88d4b7b1af Mon Sep 17 00:00:00 2001 From: James Date: Mon, 9 Feb 2026 11:26:09 -0500 Subject: [PATCH] fix: update API routes from /api/prompts to /api/trackers --- api/api_trackers.go | 12 ++++++------ api/main.go | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/api/api_trackers.go b/api/api_trackers.go index ea075ad..95fda3b 100644 --- a/api/api_trackers.go +++ b/api/api_trackers.go @@ -37,7 +37,7 @@ type TrackerRespondRequest struct { Action string `json:"action"` // "respond", "skip", "dismiss" } -// GET /api/prompts?dossier=X +// GET /api/trackers?dossier=X func handleTrackers(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") @@ -116,7 +116,7 @@ func handleTrackers(w http.ResponseWriter, r *http.Request) { } -// POST /api/prompts/respond +// POST /api/trackers/respond func handleTrackerRespond(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") @@ -173,16 +173,16 @@ func handleTrackerRespond(w http.ResponseWriter, r *http.Request) { json.NewEncoder(w).Encode(result) } -// Router for /api/prompts and /api/prompts/* +// Router for /api/trackers and /api/trackers/* func handleTrackersRouter(w http.ResponseWriter, r *http.Request) { path := r.URL.Path switch { - case path == "/api/prompts" && r.Method == "GET": + case path == "/api/trackers" && r.Method == "GET": handleTrackers(w, r) - case path == "/api/prompts" && r.Method == "POST": + case path == "/api/trackers" && r.Method == "POST": handleTrackerCreate(w, r) - case path == "/api/prompts/respond": + case path == "/api/trackers/respond": handleTrackerRespond(w, r) default: http.NotFound(w, r) diff --git a/api/main.go b/api/main.go index f2f8ba2..2c246fc 100644 --- a/api/main.go +++ b/api/main.go @@ -52,12 +52,12 @@ func main() { http.HandleFunc("/api/access", handleAccess) http.HandleFunc("/api/audit", handleAudit) http.HandleFunc("/api/entries", handleEntries) - http.HandleFunc("/api/prompts", handleTrackersRouter) - http.HandleFunc("/api/prompts/", handleTrackersRouter) + http.HandleFunc("/api/trackers", handleTrackersRouter) + http.HandleFunc("/api/trackers/", handleTrackersRouter) // http.HandleFunc("/api/prompt/generate", handlePromptGenerate) // REMOVED: Deprecated // Add the missing freeform handler - http.HandleFunc("/api/prompts/freeform", handleFreeform) + http.HandleFunc("/api/trackers/freeform", handleFreeform) // V1 API (new design) RegisterV1Routes()