diff --git a/Bank/BankBusinessLogic/BusinessLogic/CardLogic.cs b/Bank/BankBusinessLogic/BusinessLogic/CardLogic.cs index 1e997cc..d1929af 100644 --- a/Bank/BankBusinessLogic/BusinessLogic/CardLogic.cs +++ b/Bank/BankBusinessLogic/BusinessLogic/CardLogic.cs @@ -35,7 +35,7 @@ namespace BankBusinessLogic.BusinessLogic _logger.LogInformation("ReadList Count: {Count}", list.Count); return list; } - public List? ReadListByRequestId(CardSearchModel model) + public List ReadListByRequestId(CardSearchModel model) { _logger.LogInformation("ReadListByRequestId. Number: {Number}, Id: {Id}", model?.Number, model?.Id); var list = _cardStorage.GetListForRequest(model); diff --git a/Bank/BankClientApp/Controllers/HomeController.cs b/Bank/BankClientApp/Controllers/HomeController.cs index fc0554e..e6fb211 100644 --- a/Bank/BankClientApp/Controllers/HomeController.cs +++ b/Bank/BankClientApp/Controllers/HomeController.cs @@ -186,13 +186,13 @@ namespace BankClientApp.Controllers } [HttpGet] - public List? GetCards(int requestId) + public List GetCards(int requestId) { if (APIClient.Client == null) { throw new Exception("Вы как суда попали? Суда вход только авторизованным"); } - var result = APIClient.GetRequest>($"api/card/getcards?requestid={requestId}"); + var result = APIClient.GetRequest>($"api/card/getcards?requestid={requestId}"); if (result == null) { return default; diff --git a/Bank/BankContracts/BusinessLogicsContracts/ICardLogic.cs b/Bank/BankContracts/BusinessLogicsContracts/ICardLogic.cs index b53ce91..91753ac 100644 --- a/Bank/BankContracts/BusinessLogicsContracts/ICardLogic.cs +++ b/Bank/BankContracts/BusinessLogicsContracts/ICardLogic.cs @@ -13,6 +13,7 @@ namespace BankContracts.BusinessLogicsContracts { List? ReadList(CardSearchModel? model); CardViewModel? ReadElement(CardSearchModel model); + List ReadListByRequestId(CardSearchModel model); bool Create(CardBindingModel model); bool Update(CardBindingModel model); bool Delete(CardBindingModel model); diff --git a/Bank/BankContracts/StoragesContracts/ICardStorage.cs b/Bank/BankContracts/StoragesContracts/ICardStorage.cs index 9b41733..6007a6f 100644 --- a/Bank/BankContracts/StoragesContracts/ICardStorage.cs +++ b/Bank/BankContracts/StoragesContracts/ICardStorage.cs @@ -13,7 +13,7 @@ namespace BankContracts.StoragesContracts { List GetFullList(); List GetFilteredList(CardSearchModel model); - List GetListForRequest(CardSearchModel model); + List GetListForRequest(CardSearchModel model); List GetReportTransfersList(CardSearchModel model); List GetReportOperationsRequestsList(CardSearchModel model); CardViewModel? GetElement(CardSearchModel model); diff --git a/Bank/BankDatabaseImplement/Implements/CardStorage.cs b/Bank/BankDatabaseImplement/Implements/CardStorage.cs index be4e1c2..2be7b37 100644 --- a/Bank/BankDatabaseImplement/Implements/CardStorage.cs +++ b/Bank/BankDatabaseImplement/Implements/CardStorage.cs @@ -30,13 +30,13 @@ namespace BankDatabaseImplement.Implements .ToList(); } - public List GetListForRequest(CardSearchModel model) + public List GetListForRequest(CardSearchModel model) { using var context = new BankDatabase(); return context.CardRequests .Include(x => x.Card).Include(x => x.Request) .Where(x => x.RequestId==model.RequestId) - .Select(x => x.Card.GetViewModel).ToList(); + .Select(x => x.Card.Id).ToList(); } public List GetReportTransfersList(CardSearchModel model) diff --git a/Bank/BankRestApi/Controllers/CardController.cs b/Bank/BankRestApi/Controllers/CardController.cs index 9fe5feb..abdf994 100644 --- a/Bank/BankRestApi/Controllers/CardController.cs +++ b/Bank/BankRestApi/Controllers/CardController.cs @@ -36,12 +36,12 @@ namespace BankRestApi.Controllers } } - [HttpPost] - public List? GetCards(int requestId) + [HttpGet] + public List GetCards(int requestId) { try { - return _logic.ReadList(new CardSearchModel + return _logic.ReadListByRequestId(new CardSearchModel { RequestId = requestId, });