Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shipping cost update when new item is added to cart #799

Merged
merged 2 commits into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion src/frontend/components/CartItems/CartItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
);

Expand Down