Skip to content

Commit

Permalink
Add default parameters for pageNum and resultsPerPage
Browse files Browse the repository at this point in the history
  • Loading branch information
Soulfire86 committed May 26, 2016
1 parent cb27da7 commit 2f49876
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/YotpoClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,13 @@ public BottomLine GetBottomLine(string productID)
return bottomLine;
}

public ProductReviews GetReviewsForProduct(string productID)
public ProductReviews GetReviewsForProduct(string productID, int pageNum=1, int resultsPerPage=5)
{
var request = new RestRequest("v1/widget/{app_key}/products/{product_id}/reviews.json", Method.GET) { RequestFormat = DataFormat.Json };
request.AddUrlSegment("app_key", _clientId);
request.AddUrlSegment("product_id", productID);
request.AddQueryParameter("page", pageNum.ToString());
request.AddQueryParameter("per_page", resultsPerPage.ToString());

var response = Execute(request) as RestResponse;

Expand Down

0 comments on commit 2f49876

Please sign in to comment.