Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added [POST] action #75

Merged
merged 1 commit into from
Feb 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,30 @@ public IHttpActionResult SearchPricelistAssignments([FromUri]PricelistAssignment
}

/// <summary>
/// Search product prices
/// Search product prices
/// </summary>
/// <remarks>Search product prices</remarks>
[HttpGet]
[ResponseType(typeof(PricingSearchResult<webModel.ProductPrice>))]
[Route("api/catalog/products/prices/search")]
public IHttpActionResult SearchProductPrices([FromUri]PricesSearchCriteria criteria)
public IHttpActionResult SearchProductPricesGet([FromUri]PricesSearchCriteria criteria)
{
return Ok(SearchProductPricesImpl(criteria));
}

/// <summary>
/// Search product prices
/// </summary>
/// <remarks>Search product prices</remarks>
[HttpPost]
[ResponseType(typeof(PricingSearchResult<webModel.ProductPrice>))]
[Route("api/catalog/products/prices/search")]
public IHttpActionResult SearchProductPricesPost([FromBody]PricesSearchCriteria criteria)
{
return Ok(SearchProductPricesImpl(criteria));
}

private PricingSearchResult<webModel.ProductPrice> SearchProductPricesImpl(PricesSearchCriteria criteria)
{
if (criteria == null)
{
Expand Down Expand Up @@ -164,8 +181,7 @@ public IHttpActionResult SearchProductPrices([FromUri]PricesSearchCriteria crite
}
retVal.Results.Add(productPrice);
}

return Ok(retVal);
return retVal;
}

/// <summary>
Expand Down