Skip to content

Improve checkout process with inventory validation and error handling #24

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

seer-by-sentry[bot]
Copy link

Fixes REACT-60M. The issue was that: Backend inventory validation failed due to an UnboundLocalError for 'quantities', causing the fetch request to fail and resulting in a frontend TypeError.

  • Added deep copy to avoid modifying the global inventory directly during order processing.
  • Added validation to check if the product ID exists in the inventory.
  • Implemented JSON parsing error handling for the checkout route.
  • Added validation to ensure the request body contains a 'cart' key and that it is a list.

This fix was generated by Seer in Sentry, triggered by naru tsuka. 👁️ Run ID: 176196

Not quite right? Click here to continue debugging with Seer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants