what the helly
This commit is contained in:
1 parent
7954b0b70d
commit
d7ed797cda
1 file changed
+11
-2
+11
-2
@@ -261,11 +261,19 @@ 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") or LEGO_CAT_ID
|
||||
category_id = fresh_item.get("category_id")
|
||||
|
||||
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: {category_id}")
|
||||
print(f"[@DEBUG] Category ID from fresh_item: {category_id}")
|
||||
|
||||
# Ensure we have a category_id
|
||||
if not category_id:
|
||||
print(
|
||||
f"[@WARNING] No category_id in fresh_item, using LEGO_CAT_ID: {LEGO_CAT_ID}"
|
||||
)
|
||||
category_id = LEGO_CAT_ID
|
||||
|
||||
# Build upsert body
|
||||
variation_obj = {
|
||||
@@ -307,6 +315,7 @@ async def update_itm(item_id: str, lego_set: dict, item_data: dict = None):
|
||||
del variation_obj["item_variation_data"]["sku"]
|
||||
|
||||
print(f"[@DEBUG] Upserting item {item_id} with name: {pw_name}")
|
||||
print(f"[@DEBUG] Upsert body: {json.dumps(upsert_body, indent=2)}")
|
||||
|
||||
# Perform upsert using catalog.object.upsert
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user