You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR was merged into the 1.0-dev branch.
Discussion
----------
Fixes#59
## What does it do?
Currently you can add any product to any cart. After this pull request the product needs to be available in the cart's channel. So that if a product is in channel A and the cart is picked up in channel B then the product-add endpoint will now throw an error (500).
## Why a 500 and not a 400 with validation errors?
The problem is that the Validation would need to take two properties of the request into consideration: the current cart token, the product code. Which means that it has to be a "Class Constraint" and needs to access properties of the request object. This is currently not possible as the current request objects don't have getter and the properties are private. So there is no way of validating them. Therefore this pull request only adds an assertion that it is true. (validation may follow if it will be possible to do so in the future)
PS: @JakobTolkemit you might be interested.
Commits
-------
8b85fbb Addding validation for product in current channel
ba20b63 Adding getter and using a class constraint for validation
5f1c839 Removing the 500 from add to product
Right now it is possible to add a product to the cart even if this product is not available for given channel
The text was updated successfully, but these errors were encountered: