Skip to content

Commit a6f3bc2

Browse files
author
sheeek
committed
fix: use POST instead of PUT for cart-review/item endpoint
The Gurkerl API expects POST for updating cart items, not PUT. This fixes the 405 Method Not Allowed error when updating quantities. Closes #1
1 parent 4f8729d commit a6f3bc2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "gurkerlcli"
3-
version = "0.1.4"
3+
version = "0.1.5"
44
description = "CLI for gurkerl.at online grocery shopping (Austria)"
55
readme = "README.md"
66
authors = [

src/gurkerlcli/commands/cart_cmd.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def add_to_cart(product_id: str, quantity: int, debug: bool) -> None:
9494
if existing_item:
9595
# Update existing item
9696
new_quantity = existing_item.quantity + quantity
97-
response = client.put(
97+
response = client.post(
9898
f"/services/frontend-service/v2/cart-review/item/{existing_item.orderFieldId}",
9999
json={"quantity": new_quantity},
100100
)
@@ -152,7 +152,7 @@ def remove_from_cart(product_id: str, debug: bool) -> None:
152152
raise click.Abort()
153153

154154
# Remove by setting quantity to 0
155-
client.put(
155+
client.post(
156156
f"/services/frontend-service/v2/cart-review/item/{item.orderFieldId}",
157157
json={"quantity": 0},
158158
)
@@ -193,7 +193,7 @@ def clear_cart(force: bool, debug: bool) -> None:
193193

194194
# Remove all items by setting quantity to 0
195195
for item in cart_data.data.items.values():
196-
client.put(
196+
client.post(
197197
f"/services/frontend-service/v2/cart-review/item/{item.orderFieldId}",
198198
json={"quantity": 0},
199199
)

0 commit comments

Comments
 (0)