dsfadsfsa

This commit is contained in:
C committed 2026-01-04 14:11:21 -08:00
1 parent 3dfd6a27b9
commit 803a4412c1
1 file changed
+15 -13
+15 -13
View File
@@ -41,19 +41,21 @@ async def migrate_sku_to_gtin():
while True: while True:
print(f"[@INFO] Processing page {page}...") print(f"[@INFO] Processing page {page}...")
result = await client.catalog.search( search_params = {
body={ "object_types": ["ITEM"],
"object_types": ["ITEM"], "query": {
"query": { "exact_query": {
"exact_query": { "attribute_name": "category_id",
"attribute_name": "category_id", "attribute_value": SQUARE_LEGO_CAT_ID,
"attribute_value": SQUARE_LEGO_CAT_ID, }
} },
}, "limit": 100,
"limit": 100, }
"cursor": cursor,
} if cursor:
) search_params["cursor"] = cursor
result = await client.catalog.search(**search_params)
result_json = json.loads(result.model_dump_json()) result_json = json.loads(result.model_dump_json())
items = result_json.get("objects", []) items = result_json.get("objects", [])