Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ NOTE: `npm` users will still have to install the dependencies individually in th

## Reviews
To use review feature you need to install custom module for Magento 2: [Divante ReviewApi](https://github.com/DivanteLtd/magento2-review-api)
By default new reviews will be added with status "Pending".
```json
"review": {
"defaultReviewStatus": 2
},
```

## Output Cache
Vue Storefront API supports output cache for catalog operations. Cache is tagged and can by dynamically invalidated. Please find the details how to configure it [in our docs](https://docs.vuestorefront.io/guide/basics/ssr-cache.html).
Expand Down
3 changes: 3 additions & 0 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@
"userGroupId": null,
"useOnlyDefaultUserGroupId": false
},
"review": {
"defaultReviewStatus": 2
},
"bodyLimit": "100kb",
"corsHeaders": [
"Link"
Expand Down
2 changes: 2 additions & 0 deletions src/api/review.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export default ({config, db}) => {
const reviewSchema = require('../models/review.schema')
const validate = ajv.compile(reviewSchema)

req.body.review.review_status = config.review.defaultReviewStatus

if (!validate(req.body)) {
console.dir(validate.errors);
apiStatus(res, validate.errors, 500);
Expand Down