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

Mismatch the data between id product and id user in response body. #314

Open
TetianaPerinha opened this issue Jun 9, 2024 · 0 comments · Fixed by #316
Open

Mismatch the data between id product and id user in response body. #314

TetianaPerinha opened this issue Jun 9, 2024 · 0 comments · Fixed by #316
Labels
bug Something isn't working high priority High priority issue

Comments

@TetianaPerinha
Copy link
Collaborator

Describe the bug
When sending a second POST review request from the same user, a message in the response body contains mismatched data in ID product and ID user.

Precondition:
The user is registered, the Bearer token is obtained, and the user has already posted a review on a product.

To Reproduce
Send the POST request as below, and use a valid Bearer token.
curl --location 'https://iced-latte.uk/backend/api/v1/products/3ea8e601-24c9-49b1-8c65-8db8b3a5c7a3/reviews'
--header 'Content-Type: application/json'
--header 'Authorization: {token}'
--data '{
"text":"hjjkkll;;;;;;;",
"rating": "5"
}'

Expected behavior
The system should reject request with 400 HTTP Status code and return the appropriate error message = "
Creation of the product's review for the user with userId = '99999999-9999-9999-9999-999999999999' and the product with productId = '3ea8e601-24c9-49b1-8c65-8db8b3a5c7a3' is denied. Delete the previous product's review '00c106c9-fe66-4d4c-ac76-013eec3bcc29' first."

Actual result
The system rejects the request with 400 HTTP Status code and error message = "Creation of the product's review for the user with userId = '3ea8e601-24c9-49b1-8c65-8db8b3a5c7a3' and the product with productId = '99999999-9999-9999-9999-999999999999' is denied. Delete the previous product's review '00c106c9-fe66-4d4c-ac76-013eec3bcc29' first."

Comment
In the error message instead, userId displayed productId and instead, productId displayed userId.
mismatch id user and id product

@TetianaPerinha TetianaPerinha added bug Something isn't working high priority High priority issue labels Jun 9, 2024
Sunagatov added a commit that referenced this issue Jun 15, 2024
[ISSUE #314] Fix ProductReviewValidator to send correct exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority High priority issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant