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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user