diff --git a/Bank/BankClientApp/Controllers/HomeController.cs b/Bank/BankClientApp/Controllers/HomeController.cs index 38bd465..38711f5 100644 --- a/Bank/BankClientApp/Controllers/HomeController.cs +++ b/Bank/BankClientApp/Controllers/HomeController.cs @@ -521,13 +521,13 @@ namespace BankClientApp.Controllers switch (format) { case "word": - APIClient.PostRequest($"api/report/savetransferstoword", new ReportBindingModel + APIClient.PostRequest($"api/report/savetransferstoword", new ReportBindingModel { SelectedCardIds = cards, }); break; case "excel": - APIClient.PostRequest($"api/report/savetransferstoword", new ReportBindingModel + APIClient.PostRequest($"api/report/savetransferstoword", new ReportBindingModel { SelectedCardIds = cards, }); diff --git a/Bank/BankRestApi/Controllers/ReportController.cs b/Bank/BankRestApi/Controllers/ReportController.cs index 6d1cd25..d990f21 100644 --- a/Bank/BankRestApi/Controllers/ReportController.cs +++ b/Bank/BankRestApi/Controllers/ReportController.cs @@ -28,15 +28,16 @@ namespace BankRestApi.Controllers } [HttpPost] - public void SaveTransfersToWord(ReportBindingModel? model) + public void SaveTransfersToWord(ReportBindingModel model) { try { - _logic.(model); + _logic.SaveTransfersToWordFile(model); } catch(Exception ex) { - + _logger.LogError(ex, "Ошибка сохранения переводов в ворд"); + throw; } } [HttpPost] diff --git a/Bank/BankRestApi/Program.cs b/Bank/BankRestApi/Program.cs index b0191c9..a550dd8 100644 --- a/Bank/BankRestApi/Program.cs +++ b/Bank/BankRestApi/Program.cs @@ -37,6 +37,8 @@ builder.Services.AddTransient(); builder.Services.AddTransient(); builder.Services.AddTransient(); +builder.Services.AddTransient(); + builder.Services.AddTransient(); builder.Services.AddTransient(); builder.Services.AddTransient();