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: Make sure that each customer can only create one review per product #3587

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

aragon999
Copy link
Contributor

1. Why is this change necessary?

Currently the validation is not correct, such that the id of the product review will be compared with the customer id. Therefore it is possible to create multiple reviews per product (if one is omitting the id, which usually does not happen in the normal storefront). Furthermore it would be possible to overwrite the name or email from the request, which also does not happen.

2. What does this change do, exactly?

Fix the validation and always use the values from the customer object and cleanup some other stuff.

3. Describe each step to reproduce the issue or behaviour.

-

4. Please link to the relevant issues (if any).

-

5. Checklist

  • I have rebased my changes to remove merge conflicts
  • I have written tests and verified that they fail without my change
  • I have created a changelog file with all necessary information about my changes
  • I have written or adjusted the documentation according to my changes
  • This change has comments for package types, values, functions, and non-obvious lines of code
  • I have read the contribution requirements and fulfil them.

Copy link

github-actions bot commented Mar 3, 2024

Fails
🚫 The title `fix: Make sure that each customer can only create one review per product` does not match our requirements. Example: NEXT-00000 - My Title

@leduc92
Copy link
Contributor

leduc92 commented Mar 11, 2024

Hi @aragon999 , thanks for your contribution. I can understand the benefits for some customers. If we adopt this functionality, we would like to offer the merchant a choice in the form of a setting. I would suggest to add the setting on Settings > Products

@aragon999
Copy link
Contributor Author

@leduc92 a setting for what exactly do you mean? :-)

At the moment, the storefront does not offer the functionality, to create multiple reviews. Once the review is created, it is only possible to edit the review and the same customer cannot add another review. It is only possible to add a second review, when one is directly using the route, and only because of a bug in the route. So I am not sure, because adding multiple reviews, would also require some more frontend work.

@aragon999
Copy link
Contributor Author

@leduc92 any update?

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

Successfully merging this pull request may close these issues.

None yet

3 participants