diff --git a/BlacksmithWorkshop/BlacksmithWorkshopRestApi/Controllers/ShopController.cs b/BlacksmithWorkshop/BlacksmithWorkshopRestApi/Controllers/ShopController.cs index 6d1f07d..ed9d91d 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopRestApi/Controllers/ShopController.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopRestApi/Controllers/ShopController.cs @@ -76,16 +76,11 @@ namespace BlacksmithWorkshopRestApi.Controllers } [HttpPost] - public bool DeleteShop(ShopSearchModel model) - { - var elem = _logic.ReadElement(model); - if (elem == null) - return false; - try + public bool DeleteShop(ShopBindingModel model) + { + try { - return _logic.Delete(new ShopBindingModel { Id = elem.Id, Address = elem.Address, - MaxCapacity = elem.MaxCapacity, OpeningDate = elem.OpeningDate, - ShopName = elem.ShopName, ShopManufactures = elem.ShopManufactures}); + return _logic.Delete(model); } catch (Exception ex) { diff --git a/BlacksmithWorkshop/BlacksmithWorkshopShopApp/Controllers/HomeController.cs b/BlacksmithWorkshop/BlacksmithWorkshopShopApp/Controllers/HomeController.cs index 6dd3af7..db1e079 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopShopApp/Controllers/HomeController.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopShopApp/Controllers/HomeController.cs @@ -89,7 +89,7 @@ namespace BlacksmithWorkshopShopApp.Controllers { throw new Exception("Вы как сюда попали? Сюда вход только авторизованным"); } - ApiClient.PostRequest("api/shop/deleteshop", new ShopSearchModel + ApiClient.PostRequest("api/shop/deleteshop", new ShopBindingModel { Id = shop });