From 1c229494df6a42a5307f74ef65f9787f381a555d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B3=D0=BE=D1=80=D1=8C=20=D0=93=D0=BE=D1=80=D0=B4?= =?UTF-8?q?=D0=B5=D0=B5=D0=B2?= <89176335310x@gmail.com> Date: Sat, 1 Jun 2024 06:32:19 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=BD=D0=BE=20=D0=B2=D0=BE=D1=88=D0=BB?= =?UTF-8?q?=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessLogic/PaymeantLogic.cs | 2 +- .../ElectronicsShopRestAPI/Controllers/ClientController.cs | 5 ++--- .../Controllers/HomeController.cs | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) 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]