From 06aab999a17773ad3ed27e02b4b2ba50fddfd370 Mon Sep 17 00:00:00 2001 From: mattkim93 <45465140+mattkim93@users.noreply.github.com> Date: Fri, 17 Nov 2023 13:32:05 -0500 Subject: [PATCH] pass epoch time to price API (#1801) --- blocks/subscriptions-block/components/Cart/index.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/blocks/subscriptions-block/components/Cart/index.jsx b/blocks/subscriptions-block/components/Cart/index.jsx index f58f5973a3..a5a92325e7 100644 --- a/blocks/subscriptions-block/components/Cart/index.jsx +++ b/blocks/subscriptions-block/components/Cart/index.jsx @@ -11,8 +11,8 @@ const getPaymentInfo = ({ origin, endpoint, priceCode }) => { const dateMidnight = new Date(); dateMidnight.setUTCHours(0, 0, 0, 0); - return fetch(`${origin}${endpoint}${priceCode}/1/${dateMidnight}`, {}).then((res) => - res.json(), + return fetch(`${origin}${endpoint}${priceCode}/1/${dateMidnight.getTime()}`, {}).then((res) => + res.json() ); }; @@ -51,8 +51,8 @@ const Cart = ({ offerURL, className }) => { fetchPaymentInfo(item.priceCode).then((priceSummary) => ({ ...item, priceSummary, - })), - ), + })) + ) ).then((results) => { updatedCart.items = results; }); @@ -64,7 +64,7 @@ const Cart = ({ offerURL, className }) => { setCartItems( await Sales.getCart() .then(fetchCartItemSummaries) - .catch(() => []), + .catch(() => []) ); setIsFetching(false); };