From 83b1da7c9cc1338245baebe9e2e97d8b68f6524e Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Tue, 3 Oct 2023 09:12:26 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=B2?= =?UTF-8?q?=20SlipsStatController?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudWebApi/Controllers/SlipsStatController.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/AsbCloudWebApi/Controllers/SlipsStatController.cs b/AsbCloudWebApi/Controllers/SlipsStatController.cs index f5e1dec8..2bedb278 100644 --- a/AsbCloudWebApi/Controllers/SlipsStatController.cs +++ b/AsbCloudWebApi/Controllers/SlipsStatController.cs @@ -1,4 +1,5 @@ using AsbCloudApp.Data; +using AsbCloudApp.Exceptions; using AsbCloudApp.Repositories; using AsbCloudApp.Requests; using AsbCloudDb.Model; @@ -39,9 +40,13 @@ namespace AsbCloudWebApi.Controllers [FromQuery] OperationStatRequest request, CancellationToken token) { - var modal = await slipsAnalyticsService.GetAllAsync(request, token).ConfigureAwait(false); + var idUser = User.GetUserId(); - return Ok(modal); + if (!idUser.HasValue) + throw new ForbidException("Не удается вас опознать"); + + var data = await slipsAnalyticsService.GetAllAsync(request, token).ConfigureAwait(false); + return Ok(data); } } }