Fix duplicate item display immediately after adding to shopping list
This commit is contained in:
+3
-2
@@ -1181,8 +1181,9 @@ async def api_add_shopping_item(payload: ShoppingItemCreate):
|
||||
category=payload.category,
|
||||
note=payload.note or ""
|
||||
)
|
||||
await shopping_ws_manager.broadcast({"action": "items_updated", "items": get_shopping_list()})
|
||||
return {"status": "ok", "item": item}
|
||||
current_items = get_shopping_list()
|
||||
await shopping_ws_manager.broadcast({"action": "items_updated", "items": current_items})
|
||||
return {"status": "ok", "item": item, "items": current_items}
|
||||
|
||||
|
||||
@app.put("/api/shopping-list/{item_id}")
|
||||
|
||||
Reference in New Issue
Block a user