summaryrefslogtreecommitdiff
path: root/internal/handlers/handlers.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/handlers/handlers.go')
-rw-r--r--internal/handlers/handlers.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go
index c5df00d..147db07 100644
--- a/internal/handlers/handlers.go
+++ b/internal/handlers/handlers.go
@@ -715,6 +715,20 @@ func (h *Handler) HandleUnifiedAdd(w http.ResponseWriter, r *http.Request) {
}
_ = h.store.InvalidateCache(store.CacheKeyTrelloBoards)
+ case "shopping":
+ // The quick-action modal's Shopping tab. This used to create a Trello
+ // card on the Shopping board; that board is no longer a shopping
+ // source, so an item added there would have vanished from the list.
+ storeName := strings.TrimSpace(r.FormValue("store"))
+ if storeName == "" {
+ JSONError(w, http.StatusBadRequest, "Store is required for a shopping item", nil)
+ return
+ }
+ if err := h.store.SaveUserShoppingItem(title, storeName); err != nil {
+ JSONError(w, http.StatusInternalServerError, "Failed to save shopping item", err)
+ return
+ }
+
default:
JSONError(w, http.StatusBadRequest, "Invalid source", nil)
return