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); } } }