Renamed from EditProduct to UpdateProduct, also its HTTP Route, etc.
This commit is contained in:
parent
313976da80
commit
c07665aef6
@ -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();
|
||||||
|
@ -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";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user