Add delete endpoint with confirm modal, keep items at quantity 0
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 48s

- POST /delete/<product_id>/ removes the cart item entirely
- POST /quantity/ now clamps at 0 instead of deleting
- cart_delete_url Jinja global registered for template

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-19 09:43:35 +00:00
parent 8c72664e1f
commit 17ab7f09c7
3 changed files with 26 additions and 5 deletions

1
app.py
View File

@@ -100,6 +100,7 @@ def create_app() -> "Quart":
])
app.jinja_env.globals["cart_quantity_url"] = lambda product_id: f"/quantity/{product_id}/"
app.jinja_env.globals["cart_delete_url"] = lambda product_id: f"/delete/{product_id}/"
# --- Page slug hydration (follows events/market app pattern) ---