Routes : ProductRating
File Name : productratings.js
File Path : server/routes/api/productratings.js
Contains route which can cerate, update, view and delete the user details. These functionalities are included in productratings Controller.
Post ProductRating Route
1.API Path:
api/productratings
2.Method:
POST
3.Description:
ProductRating route is used to create a new ProductRating.
4.Parameters:
Name: req
Type: Object
Name | Type | Required |
---|---|---|
restaurantID | ObjectId | true |
location | ObjectId | true |
order | ObjectId | true |
category | ObjectId | true |
subcategory | ObjectId | true |
product | ObjectId | true |
user | ObjectId | true |
rating | Number | true |
ratingCount | Number | true |
comment | String | true |
Response:
Http Code:200
Data:{ }
Type: Object
Name | Type |
---|---|
statusCode | Number |
Data | Object |
Description:Data is an Object with an productRating.
Get ProductRating Route
1.API Path:
api/productratings
2.Method:
GET
3.Description:
ProductRating route is used to get all ProductRatings.
4.Parameters:
Name: req
Type: Object
Response:
Http Code:200
Data:[ ]
Type: Array
Name | Type |
---|---|
statusCode | Number |
Data | Array |
Description:Data is an Array with all productRatings.
Get ProductRating(particular) Route
1.API Path:
api/productratings/:id
2.Method:
GET
3.Description:
ProductRating route is used to get particular ProductRating.
4.Parameters:
Name: req,
Type: Object
id:req.params.id
Response:
Http Code:200
Data:{ }
Type: Object
Name | Type |
---|---|
statusCode | Number |
Data | Array |
Description:Data is an Object with a particular productRating.
Update ProductRating(particular) Route
1.API Path:
api/productratings/:id
2.Method:
PUT
3.Description:
ProductRating route is used to update particular ProductRating.
4.Parameters:
Name: req,
Type: Object,
id: req.params.id
Response:
Http Code:200
Data:{ }
Type: Object
Name | Type |
---|---|
statusCode | Number |
Data | Object |
Description:Data is an Object with a particular productRating.
Delete ProductRating(particular) Route
1.API Path:
api/productratings/:id
2.Method:
DELETE
3.Description:
ProductRating route is used to delete a particular ProductRating.
4.Parameters:
Name: req,
Type: Object,
id: req.params.id
Response:
Http Code:404
Data:{ }
Type: Object
Name | Type |
---|---|
statusCode | Number |
Data | blank object |
Description:Data is an blank Object productRating.
Get ProductRating(particular productId) Route
1.API Path:
api/productratings/product/:id
2.Method:
GET
3.Description:
ProductRating route is used to get particular ProductRating.
4.Parameters:
Name: req,
Type: Object,
id: req.params.id(productId)
Response:
Http Code:200
Data:{ }
Type: Object
Name | type |
---|---|
statusCode | Number |
Data | Object |
Description:Data is an Object with a particular productRating.