From 231f726d08b573a3a6a95a01d1c506a09fac1151 Mon Sep 17 00:00:00 2001 From: Dominic Ferrando Date: Sun, 8 Jun 2025 13:05:49 -0400 Subject: [PATCH] update --- webflow.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/webflow.ts b/webflow.ts index 471b43b..e5c87b3 100644 --- a/webflow.ts +++ b/webflow.ts @@ -123,12 +123,12 @@ export namespace Webflow { "Authorization": `bearer ${Bun.env.WEBFLOW_AUTH}` } }); - const product = await getProductResponse.json(); + const webflowProduct = await getProductResponse.json(); - for (let i = 0; i < product["skus"].length; ++i) { + for (let i = 0; i < webflowProduct["skus"].length; ++i) { const webflowSkuId = variantExternalIds[i]; - await fetch(`${API_URL}/products/${webflowProductId}/skus/${webflowSkuId}`, { + const res = await fetch(`${API_URL}/products/${webflowProductId}/skus/${webflowSkuId}`, { method: "PATCH", headers: { "Content-Type": "application/json", @@ -138,11 +138,8 @@ export namespace Webflow { "sku": webflowVariants[i] }) }); + console.log(JSON.stringify((await res.json()))); } - - return { - "updateProduct": updateProductResponse, - }; } export async function createProduct(printfulProduct: Printful.Products.SyncProduct, productRecords: ProductRecords) { @@ -248,8 +245,10 @@ export namespace Webflow { }) }); modifyPrintfulProductResponse = await modifyPrintfulProductResponse.json(); + console.log(JSON.stringify(modifyPrintfulProductResponse)); // CACHE WEBFLOW/PRINTFUL PRODUCT ASSOCIATION productRecords.add({ printfulProductId, webflowProductId }); } } +