diff --git a/ElectronicsShop/ElectronicsShopBusinessLogic/BusinessLogic/PaymeantLogic.cs b/ElectronicsShop/ElectronicsShopBusinessLogic/BusinessLogic/PaymeantLogic.cs index 3a10116..4a4c582 100644 --- a/ElectronicsShop/ElectronicsShopBusinessLogic/BusinessLogic/PaymeantLogic.cs +++ b/ElectronicsShop/ElectronicsShopBusinessLogic/BusinessLogic/PaymeantLogic.cs @@ -57,7 +57,7 @@ namespace ElectronicsShopBusinessLogic.BusinessLogic return null; } _logger.LogInformation($"ReadList.Count:{list.Count}"); - return null; + return list; } diff --git a/ElectronicsShop/ElectronicsShopRestAPI/Controllers/ClientController.cs b/ElectronicsShop/ElectronicsShopRestAPI/Controllers/ClientController.cs index 8598ce9..665dbe2 100644 --- a/ElectronicsShop/ElectronicsShopRestAPI/Controllers/ClientController.cs +++ b/ElectronicsShop/ElectronicsShopRestAPI/Controllers/ClientController.cs @@ -66,11 +66,10 @@ namespace ElectronicsShopRestAPI.Controllers { _logger.LogError(ex, "Ошибка создания оплаты"); } } - - [HttpPost] + [HttpGet] public List? GetPaymeants(int _clientID) { try { - return _payLogic.ReadList(new PaymeantSearchModel { ClientID = _clientID }); + return _payLogic?.ReadList(new PaymeantSearchModel { ClientID = _clientID }); } catch (Exception ex) { _logger.LogError(ex, $"Ошибка получения списка оплат клиента id = {_clientID}"); diff --git a/ElectronicsShop/ElectronicsShopShopClientApp/Controllers/HomeController.cs b/ElectronicsShop/ElectronicsShopShopClientApp/Controllers/HomeController.cs index 2ceec77..c79e36d 100644 --- a/ElectronicsShop/ElectronicsShopShopClientApp/Controllers/HomeController.cs +++ b/ElectronicsShop/ElectronicsShopShopClientApp/Controllers/HomeController.cs @@ -24,12 +24,12 @@ namespace ElectronicsShopUserApp.Controllers { //_order = orderLogic; _productList = new Dictionary(); } - + [HttpGet] public IActionResult Index() { if (APIClient.Client == null) { return Redirect("~/Home/Enter"); } - return View(APIClient.GetRequset>($"api/client/getpaymeants?_clientid={APIClient.Client.ID}")); + return View(APIClient.GetRequset>($"api/Client/GetPaymeants?_clientid={APIClient.Client.ID}")); } [HttpGet]