Add catalogitem update endpoint to public api (#418)

* Initial update endpoint working

* Updated CatalogItem to support more updates; added tests

* Got MediatR domain events working to check for duplicate item names

* Adding reference link

* Remove domain events spike code

* clean up usings
This commit is contained in:
Steve Smith
2020-07-10 11:50:46 -04:00
committed by GitHub
parent f89c20ee64
commit 1c75f08a33
13 changed files with 205 additions and 7 deletions

View File

@@ -18,7 +18,7 @@ namespace Microsoft.eShopWeb.Web.Services
public async Task UpdateCatalogItem(CatalogItemViewModel viewModel)
{
var existingCatalogItem = await _catalogItemRepository.GetByIdAsync(viewModel.Id);
existingCatalogItem.Update(viewModel.Name, viewModel.Price);
existingCatalogItem.UpdateDetails(viewModel.Name, existingCatalogItem.Description, viewModel.Price);
await _catalogItemRepository.UpdateAsync(existingCatalogItem);
}
}