CATEGORY ID IS NONE??????

This commit is contained in:
C committed 2026-01-04 11:56:27 -08:00
1 parent d07f66ca57
commit 30b4b26c9e
1 file changed
+11 -1
+11 -1
View File
@@ -167,11 +167,21 @@ async def get_item_by_variation_id(variation_id: str) -> dict:
print( print(
f"[@DEBUG] Found parent item: {obj['id']} on page {page_count}" f"[@DEBUG] Found parent item: {obj['id']} on page {page_count}"
) )
# Since we searched by category, we know it's in LEGO_CAT_ID
# But also try to get from item_data as fallback
category_id = item_data.get("category_id") or LEGO_CAT_ID
print(
f"[@DEBUG] Item category_id from data: {item_data.get('category_id')}"
)
print(f"[@DEBUG] Using category_id: {category_id}")
return { return {
"id": obj["id"], "id": obj["id"],
"name": item_data.get("name", ""), "name": item_data.get("name", ""),
"description": item_data.get("description", ""), "description": item_data.get("description", ""),
"category_id": item_data.get("category_id"), "category_id": category_id,
"variations": variations, "variations": variations,
"updated_at": obj.get("updated_at"), "updated_at": obj.get("updated_at"),
"version": obj.get("version"), "version": obj.get("version"),