From 9f38a6be20a7afdf6aaf8a1c99fd13a07e5cf313 Mon Sep 17 00:00:00 2001 From: Edwin Obando Date: Mon, 24 Jun 2024 11:45:29 -0500 Subject: [PATCH 1/2] feat: support contact information field --- react/fetchers/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/react/fetchers/index.js b/react/fetchers/index.js index 42a93bb..a3954d3 100644 --- a/react/fetchers/index.js +++ b/react/fetchers/index.js @@ -134,6 +134,8 @@ export function updateShippingData( return li }) + const contactInformation = window?.vtexjs?.checkout?.orderForm?.shippingData?.contactInformation ?? [] + const shippingData = { ...(hasGeocoordinates ? { clearAddressIfPostalCodeNotFound: false } : {}), selectedAddresses: [ @@ -141,6 +143,7 @@ export function updateShippingData( pickupAddressWithAddressId, ], logisticsInfo: logisticsInfoWithDefaultDeliverySla, + contactInformation, } return ( From e39be21e18e92760248d8593c63c18bf82563da0 Mon Sep 17 00:00:00 2001 From: Edwin Obando Date: Thu, 4 Jul 2024 10:44:25 -0500 Subject: [PATCH 2/2] fix: adapt to new protocol --- react/fetchers/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react/fetchers/index.js b/react/fetchers/index.js index a3954d3..16598ac 100644 --- a/react/fetchers/index.js +++ b/react/fetchers/index.js @@ -134,7 +134,7 @@ export function updateShippingData( return li }) - const contactInformation = window?.vtexjs?.checkout?.orderForm?.shippingData?.contactInformation ?? [] + const contactInformation = window?.vtexjs?.checkout?.orderForm?.shippingData?.contactInformation?.map(({ id }) => ({ id })) ?? [] const shippingData = { ...(hasGeocoordinates ? { clearAddressIfPostalCodeNotFound: false } : {}),