@feardread/fear 2.0.2 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,8 +8,8 @@ const Product = require("../models/product");
8
8
  * @param {Object} res - Express response object
9
9
  */
10
10
  exports.review = tryCatch(async (req, res) => {
11
- const { productId, username, email, rating, comment } = req.body;
12
- //const productId = req.params.id;
11
+ const { username, email, rating, comment } = req.body;
12
+ const productId = req.params.productId || req.body.productId;
13
13
  //const userId = req.user._id;
14
14
 
15
15
  // Validate required fields
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feardread/fear",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/routes/review.js CHANGED
@@ -5,7 +5,7 @@ module.exports = (fear) => {
5
5
 
6
6
  router.post("/new", Review.review)
7
7
  .get("/rating", Review.rating)
8
- .get("/by-product/:id", Review.getProductReviews);
9
-
8
+ .get("/by-product/:productId", Review.getProductReviews);
9
+ router.get("/by-product", Review.getProductReviews);
10
10
  return router;
11
11
  };