fetchRatings
Constants
- fetchRatingById ⇒
Promise.<Object>
Fetch the rating of a product by id.
- addRating ⇒
Promise.<Object>
Add a rating for a product.
- editRating ⇒
Promise.<Object>
Edit a rating for a product.
- fetchUserRatingById ⇒
Promise.<Object>
Fetch the user's rating by id.
- addUserRating ⇒
Promise.<Object>
Add a rating for a user.
- editUserRating ⇒
Promise.<Object>
Edit a rating for a user.
fetchRatingById ⇒ Promise.<Object>
Fetch the rating of a product by id.
Kind: global constant
Returns: Promise.<Object>
- The response data.
Throws:
Error
If the response status is not 200 or 204.
Param | Type | Description |
---|---|---|
id | string | The id of the product. |
token | string | The authorization token. |
addRating ⇒ Promise.<Object>
Add a rating for a product.
Kind: global constant
Returns: Promise.<Object>
- The response data.
Throws:
Error
If the response status is not 201.
Param | Type | Description |
---|---|---|
rating | number | The rating value. |
product | string | The id of the product. |
token | string | The authorization token. |
editRating ⇒ Promise.<Object>
Edit a rating for a product.
Kind: global constant
Returns: Promise.<Object>
- The response data.
Throws:
Error
If the response status is not 201.
Param | Type | Description |
---|---|---|
rating | number | The new rating value. |
product | string | The id of the product. |
token | string | The authorization token. |
fetchUserRatingById ⇒ Promise.<Object>
Fetch the user's rating by id.
Kind: global constant
Returns: Promise.<Object>
- The response data.
Throws:
Error
If the response status is not 200 or 204.
Param | Type | Description |
---|---|---|
id | string | The id of the user. |
token | string | The authorization token. |
addUserRating ⇒ Promise.<Object>
Add a rating for a user.
Kind: global constant
Returns: Promise.<Object>
- The response data.
Throws:
Error
If the response status is not 201.
Param | Type | Description |
---|---|---|
rating | number | The rating value. |
seller | string | The id of the seller. |
token | string | The authorization token. |
editUserRating ⇒ Promise.<Object>
Edit a rating for a user.
Kind: global constant
Returns: Promise.<Object>
- The response data.
Throws:
Error
If the response status is not 201.
Param | Type | Description |
---|---|---|
rating | number | The new rating value. |
seller | string | The id of the seller. |
token | string | The authorization token. |