Report the item a cart action actually acted on
_cart_action scraped the first .item-name off the item page, which belongs to whatever is in the mini-cart rather than the item being added — so an add announced someone else's groceries in its event payload. Callers pass the name they resolved instead; verified by an add/remove round trip against a live order.
This commit is contained in:
@@ -151,7 +151,7 @@ class FreshHarvestBox(FreshHarvestEntity, TodoListEntity):
|
||||
item_id, name = await self._algolia_lookup(query)
|
||||
try:
|
||||
result = await self.coordinator.actions.async_add_item(
|
||||
item_id, dry_run=False
|
||||
item_id, dry_run=False, name=name
|
||||
)
|
||||
except FreshHarvestError as err:
|
||||
self._fire(EVENT_ACTION, "add_item", False, query, str(err))
|
||||
@@ -166,7 +166,7 @@ class FreshHarvestBox(FreshHarvestEntity, TodoListEntity):
|
||||
item_id, name = await self._algolia_lookup(uid)
|
||||
try:
|
||||
await self.coordinator.actions.async_remove_item(
|
||||
item_id, dry_run=False
|
||||
item_id, dry_run=False, name=name
|
||||
)
|
||||
except FreshHarvestError as err:
|
||||
self._fire(EVENT_ACTION, "remove_item", False, uid, str(err))
|
||||
|
||||
Reference in New Issue
Block a user