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

Frontend: Validate the product quantities when creating an order #30

Open
chrishappy opened this issue Feb 26, 2022 · 1 comment
Open

Comments

@chrishappy
Copy link
Owner

Since product quantities are not updated in real-time, it's possible that the quantities are invalid (e.g. a different client checked out some of the same items recently).

Thus, before we submit an order, we should check that the quantities are still valid.

@chrishappy chrishappy moved this from Done to Todo in Smooth Shopping - House of Omeed Feb 26, 2022
@chrishappy chrishappy changed the title Validate the quantities are valid when creating an order Validate the product quantities when creating an order Feb 26, 2022
@chrishappy chrishappy changed the title Validate the product quantities when creating an order Frontend: Validate the product quantities when creating an order Feb 26, 2022
@chrishappy
Copy link
Owner Author

// TODO: Validate the order before submitting
// Create a new function in cartHelper
// 1. use the promise in usePreviousOrderQuantitiesUpdater(), then
// 2. loop over all the products in the cart and check that the quantity
//      that is not greater than the maximum
// 3. if it is, make the color red and disable the button

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

No branches or pull requests

1 participant