-
Notifications
You must be signed in to change notification settings - Fork 1
ProductsModule.Class.ProductReviewService
tgreyuk edited this page Apr 25, 2024
·
1 revision
github-wiki-example / ProductsModule / ProductReviewService
Service for managing product reviews.
new ProductReviewService():
ProductReviewService
| Property | Modifier | Type | Default value |
|---|---|---|---|
reviews |
private |
ProductReview[] |
[] |
addProductReview(
review):ProductReview
Add a new product review.
| Parameter | Type | Description |
|---|---|---|
review |
ProductReview |
The product review to be added. |
The added product review.
products.ts:159
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.
products.ts:178
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.
products.ts:169