From c13a1b2a717377068fa79467c57381e6fc127b99 Mon Sep 17 00:00:00 2001 From: RavilGismatullin Date: Tue, 27 Aug 2024 22:26:31 +0400 Subject: [PATCH] fix --- .../Controllers/HomeController.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ServiceStation/ServiceStationExecutorApp/Controllers/HomeController.cs b/ServiceStation/ServiceStationExecutorApp/Controllers/HomeController.cs index 0c0433f..10fbbfa 100644 --- a/ServiceStation/ServiceStationExecutorApp/Controllers/HomeController.cs +++ b/ServiceStation/ServiceStationExecutorApp/Controllers/HomeController.cs @@ -267,6 +267,11 @@ namespace ServiceSourceClientApp.Controllers { [HttpGet] public IActionResult CreateWordReport(string ids) { + if (string.IsNullOrEmpty(ids)) { + throw new Exception("Нет выбраных записей"); + } + + var fileMemStream = APIClient.GetRequest($"api/Main/CreateWordReport?_ids={ids}"); if (fileMemStream == null) { @@ -278,7 +283,12 @@ namespace ServiceSourceClientApp.Controllers { [HttpGet] public IActionResult CreateExcelReport(string ids) { - var fileMemStream = APIClient.GetRequest($"api/Main/CreateXlsxReport?_ids={ids}"); + + if (string.IsNullOrEmpty(ids)) { + throw new Exception("Нет выбраных записей"); + } + + var fileMemStream = APIClient.GetRequest($"api/Main/CreateXlsxReport?_ids={ids}"); if (fileMemStream == null) { throw new Exception("Ошибка создания отчета");