diff --git a/CHANGELOG.md b/CHANGELOG.md index c98d4decec..42b848469b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ release. ([#795](https://github.com/open-telemetry/opentelemetry-demo/pull/795)) * Add logs for Ad service and Recommendation service ([#796](https://github.com/open-telemetry/opentelemetry-demo/pull/796)) +* Fixed shipping update in the frontend UI when number of products in cart changes +([#799](https://github.com/open-telemetry/opentelemetry-demo/pull/799)) ## v0.1.0 diff --git a/src/frontend/components/CartItems/CartItems.tsx b/src/frontend/components/CartItems/CartItems.tsx index 0ad0365235..095ae4d7e5 100644 --- a/src/frontend/components/CartItems/CartItems.tsx +++ b/src/frontend/components/CartItems/CartItems.tsx @@ -36,7 +36,9 @@ const CartItems = ({ productList, shouldShowPrice = true }: IProps) => { country: 'United States', zipCode: '94043', }; - const { data: shippingConst = { units: 0, currencyCode: 'USD', nanos: 0 } } = useQuery('shipping', () => + + const { data: shippingConst = { units: 0, currencyCode: 'USD', nanos: 0 } } = useQuery(['shipping', + productList, selectedCurrency, address], () => ApiGateway.getShippingCost(productList, selectedCurrency, address) );