Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

Commit cc821b8

Browse files
authored
Merge pull request #99 from afirlejczyk/feature/reviews
Reviews - small fixes.
2 parents e0ae272 + 0fe5115 commit cc821b8

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ Executing `docker exec -it vuestorefrontapi_app_1 yarn install` will also downlo
9393

9494
NOTE: `npm` users will still have to install the dependencies individually in their modules.
9595

96+
## Reviews
97+
To use review feature you need to install custom module for Magento 2: [Divante ReviewApi](https://github.com/DivanteLtd/magento2-review-api)
98+
9699
License
97100
-------
98101

src/models/review.schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
"properties": {
77
"review": {
88
"required": [
9-
"entity_pk_value",
9+
"product_id",
1010
"title",
1111
"detail",
1212
"nickname",
1313
"review_entity",
1414
"review_status"
1515
],
1616
"properties": {
17-
"entity_pk_value": {
17+
"product_id": {
1818
"type": "integer"
1919
},
2020
"title": {

src/platform/magento2/review.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ class ReviewProxy extends AbstractReviewProxy {
99
}
1010

1111
create (reviewData) {
12+
reviewData.entity_pk_value = reviewData.product_id
13+
delete reviewData.product_id
14+
1215
return this.api.reviews.create(reviewData)
1316
}
1417
}

0 commit comments

Comments
 (0)