summaryrefslogtreecommitdiff
path: root/internal/handlers
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-06-29 09:08:02 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-06-29 09:08:02 +0000
commit509ae15621a3981246e8b2b54804959294938d42 (patch)
tree9ebd8553935d07dd6c57066c0d925d17c2290759 /internal/handlers
parent3fbfdd1f9441299eb146bf215449f238977deb66 (diff)
feat: make Todoist optional, guard nil client calls
TODOIST_API_KEY is no longer required — native task management works without it. Guards nil todoistClient in handleAtomToggle. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/handlers')
-rw-r--r--internal/handlers/handlers.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go
index 877293a..5ecaf7c 100644
--- a/internal/handlers/handlers.go
+++ b/internal/handlers/handlers.go
@@ -612,6 +612,10 @@ func (h *Handler) handleAtomToggle(w http.ResponseWriter, r *http.Request, compl
err = h.store.UncompleteNativeTask(id)
}
case "todoist":
+ if h.todoistClient == nil {
+ JSONError(w, http.StatusServiceUnavailable, "Todoist not configured", nil)
+ return
+ }
if complete {
err = h.todoistClient.CompleteTask(ctx, id)
} else {