-
Notifications
You must be signed in to change notification settings - Fork 2
products.Class.ProductReviewService
tgreyuk edited this page Sep 6, 2024
·
6 revisions
github-wiki-example / products / ProductReviewService
Service for managing product reviews.
new ProductReviewService():
ProductReviewService
addProductReview(
review
):ProductReview
Add a new product review.
Parameter | Type | Description |
---|---|---|
review |
ProductReview |
The product review to be added. |
The added product review.
getAverageRating(
productId
):number
Get the average rating for a specific product.
Parameter | Type | Description |
---|---|---|
productId |
string |
The ID of the product. |
number
The average rating for the specified product.
getProductReviews(
productId
):ProductReview
[]
Get all product reviews for a specific product.
Parameter | Type | Description |
---|---|---|
productId |
string |
The ID of the product. |
An array of product reviews for the specified product.