Skip to content

Commit

Permalink
pass epoch time to price API (#1801)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkim93 authored Nov 17, 2023
1 parent 153b932 commit 06aab99
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions blocks/subscriptions-block/components/Cart/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
};

Expand Down Expand Up @@ -51,8 +51,8 @@ const Cart = ({ offerURL, className }) => {
fetchPaymentInfo(item.priceCode).then((priceSummary) => ({
...item,
priceSummary,
})),
),
}))
)
).then((results) => {
updatedCart.items = results;
});
Expand All @@ -64,7 +64,7 @@ const Cart = ({ offerURL, className }) => {
setCartItems(
await Sales.getCart()
.then(fetchCartItemSummaries)
.catch(() => []),
.catch(() => [])
);
setIsFetching(false);
};
Expand Down

0 comments on commit 06aab99

Please sign in to comment.