deleteProductReview method

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

Deletes an existing Product Review and returns the WooProductReview object.

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

Implementation

Future<WooProductReview> deleteProductReview({required int reviewId}) async {
  Map data = {
    'force': true,
  };
  _printToLog(
      'Deleting product review With reviewId : ' + reviewId.toString());
  _setApiResourceUrl(
    path: 'products/review/' + reviewId.toString(),
  );
  final response = await delete(queryUri.toString(), data);
  return WooProductReview.fromJson(response);
}