Updated CatalogItem to support more updates; added tests

This commit is contained in:
Steve Smith
2020-07-03 12:46:33 -04:00
parent 14fbb4284a
commit 2911d5821e
4 changed files with 101 additions and 4 deletions

View File

@@ -33,7 +33,9 @@ namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints
var existingItem = await _itemRepository.GetByIdAsync(request.Id);
existingItem.Update(request.Name, request.Price);
existingItem.UpdateDetails(request.Name, request.Description, request.Price);
existingItem.UpdateBrand(request.CatalogBrandId);
existingItem.UpdateType(request.CatalogTypeId);
await _itemRepository.UpdateAsync(existingItem);