From 1445449dc8ad0645e5e22aa8e4ec2c23d7379762 Mon Sep 17 00:00:00 2001 From: Abrasimov Yaroslav Date: Wed, 4 Dec 2024 20:46:04 +0100 Subject: [PATCH] Adjust blocks URLs --- blocks/commerce-order-returns/commerce-order-returns.js | 2 +- blocks/commerce-orders-list/commerce-orders-list.js | 2 +- blocks/commerce-returns-list/commerce-returns-list.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/blocks/commerce-order-returns/commerce-order-returns.js b/blocks/commerce-order-returns/commerce-order-returns.js index 34db43d3e3..1f2658f469 100644 --- a/blocks/commerce-order-returns/commerce-order-returns.js +++ b/blocks/commerce-order-returns/commerce-order-returns.js @@ -34,6 +34,6 @@ export default async function decorate(block) { return `${returnDetailsPath}?orderRef=${encodedOrderRef}&returnRef=${returnNumber}`; }, - routeProductDetails: (productData) => (productData ? `/products/${productData.product.urlKey}/${productData.product.sku}` : '#'), + routeProductDetails: (productData) => (productData?.product ? `/products/${productData.product.urlKey}/${productData.product.sku}` : '#'), })(block); } diff --git a/blocks/commerce-orders-list/commerce-orders-list.js b/blocks/commerce-orders-list/commerce-orders-list.js index 8b0fb62af3..f84066106c 100644 --- a/blocks/commerce-orders-list/commerce-orders-list.js +++ b/blocks/commerce-orders-list/commerce-orders-list.js @@ -32,7 +32,7 @@ export default async function decorate(block) { routeOrdersList: () => CUSTOMER_ORDERS_PATH, routeOrderDetails: (orderNumber) => `${CUSTOMER_ORDER_DETAILS_PATH}?orderRef=${orderNumber}`, routeReturnDetails: ({ orderNumber, returnNumber }) => `${CUSTOMER_RETURN_DETAILS_PATH}?orderRef=${orderNumber}&returnRef=${returnNumber}`, - routeOrderProduct: (productData) => (productData ? `/products/${productData.product.urlKey}/${productData.product.sku}` : '#'), + routeOrderProduct: (productData) => (productData?.product ? `/products/${productData.product.urlKey}/${productData.product.sku}` : '#'), })(block); } } diff --git a/blocks/commerce-returns-list/commerce-returns-list.js b/blocks/commerce-returns-list/commerce-returns-list.js index d71f9bb905..3a18d05424 100644 --- a/blocks/commerce-returns-list/commerce-returns-list.js +++ b/blocks/commerce-returns-list/commerce-returns-list.js @@ -34,7 +34,7 @@ export default async function decorate(block) { routeReturnDetails: ({ orderNumber, returnNumber }) => `${CUSTOMER_RETURN_DETAILS_PATH}?orderRef=${orderNumber}&returnRef=${returnNumber}`, routeOrderDetails: ({ orderNumber }) => `${CUSTOMER_ORDER_DETAILS_PATH}?orderRef=${orderNumber}`, routeReturnsList: () => CUSTOMER_RETURNS_PATH, - routeProductDetails: (productData) => (productData ? `/products/${productData.product.urlKey}/${productData.product.sku}` : '#'), + routeProductDetails: (productData) => (productData?.product ? `/products/${productData.product.urlKey}/${productData.product.sku}` : '#'), })(block); } }