location location location!
This commit is contained in:
1 parent
bf7ebdab05
commit
b988db11ec
1 file changed
+4
-2
+4
-2
@@ -262,11 +262,12 @@ async def update_itm(item_id: str, lego_set: dict, item_data: dict = None):
|
||||
# Get current version for version control
|
||||
current_version = fresh_item.get("version")
|
||||
category_id = fresh_item.get("category_id")
|
||||
present_at_location_ids = fresh_item.get("present_at_location_ids", [])
|
||||
|
||||
print(f"[@DEBUG] Fresh item data: {fresh_item}")
|
||||
print(f"[@DEBUG] Fresh item version: {current_version}")
|
||||
print(f"[@DEBUG] Fresh variation version: {variation_version}")
|
||||
print(f"[@DEBUG] Category ID from fresh_item: {category_id}")
|
||||
print(f"[@DEBUG] Present at locations: {present_at_location_ids}")
|
||||
|
||||
# Ensure we have a category_id
|
||||
if not category_id:
|
||||
@@ -301,7 +302,8 @@ async def update_itm(item_id: str, lego_set: dict, item_data: dict = None):
|
||||
"type": "ITEM",
|
||||
"id": item_id,
|
||||
"version": current_version, # Include version for conflict prevention
|
||||
"present_at_all_locations": False, # Required when using category_id
|
||||
"present_at_all_locations": False, # Required when using specific locations
|
||||
"present_at_location_ids": present_at_location_ids, # Preserve location assignment
|
||||
"item_data": {
|
||||
"name": pw_name,
|
||||
"description": f"{set_name} - {set_theme}",
|
||||
|
||||
Reference in new issue
Block a user