Skip to main content

fetchRatings

Constants

fetchRatingByIdPromise.<Object>

Fetch the rating of a product by id.

addRatingPromise.<Object>

Add a rating for a product.

editRatingPromise.<Object>

Edit a rating for a product.

fetchUserRatingByIdPromise.<Object>

Fetch the user's rating by id.

addUserRatingPromise.<Object>

Add a rating for a user.

editUserRatingPromise.<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.
ParamTypeDescription
idstringThe id of the product.
tokenstringThe 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.
ParamTypeDescription
ratingnumberThe rating value.
productstringThe id of the product.
tokenstringThe 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.
ParamTypeDescription
ratingnumberThe new rating value.
productstringThe id of the product.
tokenstringThe 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.
ParamTypeDescription
idstringThe id of the user.
tokenstringThe 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.
ParamTypeDescription
ratingnumberThe rating value.
sellerstringThe id of the seller.
tokenstringThe 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.
ParamTypeDescription
ratingnumberThe new rating value.
sellerstringThe id of the seller.
tokenstringThe authorization token.