getProductReviewById method

Future<WooProductReview> getProductReviewById({
  1. required int reviewId,
})

Returns a WooProductReview, with the specified reviewId.

Related endpoint: https://woocommerce.github.io/woocommerce-rest-api-docs/#product-reviews

Implementation

Future<WooProductReview> getProductReviewById({required int reviewId}) async {
  WooProductReview productReview;
  _setApiResourceUrl(
    path: 'products/reviews/' + reviewId.toString(),
  );
  final response = await get(queryUri.toString());
  _printToLog('response gotten : ' + response.toString());
  productReview = WooProductReview.fromJson(response);
  return productReview;
}