Renamed from EditProduct to UpdateProduct, also its HTTP Route, etc.

This commit is contained in:
Cesar De la Torre 2017-03-25 15:50:26 -07:00
parent 313976da80
commit c07665aef6
2 changed files with 4 additions and 4 deletions

View File

@ -136,10 +136,10 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers
return Ok(items); return Ok(items);
} }
//POST api/v1/[controller]/edit //POST api/v1/[controller]/update
[Route("edit")] [Route("update")]
[HttpPost] [HttpPost]
public async Task<IActionResult> EditProduct([FromBody]CatalogItem productToUpdate) public async Task<IActionResult> UpdateProduct([FromBody]CatalogItem productToUpdate)
{ {
var catalogItem = await _catalogContext.CatalogItems.SingleOrDefaultAsync(i => i.Id == productToUpdate.Id); var catalogItem = await _catalogContext.CatalogItems.SingleOrDefaultAsync(i => i.Id == productToUpdate.Id);
if (catalogItem == null) return NotFound(); if (catalogItem == null) return NotFound();

View File

@ -34,7 +34,7 @@ namespace FunctionalTests.Services.Catalog
public static class Post public static class Post
{ {
public static string UpdateCatalogProduct = "api/v1/catalog/edit"; public static string UpdateCatalogProduct = "api/v1/catalog/update";
} }
} }
} }