From 2894160cb9fcd617c8523820fef0434f144d5970 Mon Sep 17 00:00:00 2001 From: Shashank Shirke Date: Sun, 4 Sep 2022 22:42:47 -0700 Subject: [PATCH] fix: remove the trailing comma after the last SKU (#201) Instead of using the reduce() method to explode the list of SKUs into separate objects, we can use the map() method and get rid of the trailing comma after the last SKU --- .../page/shopify_import_products/shopify_import_products.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecommerce_integrations/shopify/page/shopify_import_products/shopify_import_products.js b/ecommerce_integrations/shopify/page/shopify_import_products/shopify_import_products.js index dadb243c..f3d63f22 100644 --- a/ecommerce_integrations/shopify/page/shopify_import_products/shopify_import_products.js +++ b/ecommerce_integrations/shopify/page/shopify_import_products/shopify_import_products.js @@ -174,7 +174,7 @@ shopify.ProductImporter = class { // 'Image': product.image && product.image.src && ``, 'ID': product.id, 'Name': product.title, - 'SKUs': product.variants && product.variants.reduce((a, b) => a + `${b.sku}, `, ''), + 'SKUs': product.variants && product.variants.map(a => `${a.sku}`).join(', '), 'Status': this.getProductSyncStatus(product.synced), 'Action': !product.synced ? `` : '-', }));