diff --git a/AsbCloudInfrastructure/Services/FileService.cs b/AsbCloudInfrastructure/Services/FileService.cs index f9c8cd73..f34be6cf 100644 --- a/AsbCloudInfrastructure/Services/FileService.cs +++ b/AsbCloudInfrastructure/Services/FileService.cs @@ -53,27 +53,27 @@ namespace AsbCloudInfrastructure.Services if (telemetry is null) return null; - var filesInfoFromDb = db.Files.Include(f => f.User) + var filesInfoQuery = db.Files.Include(f => f.User) .Where(f => f.IdWell == wellId && f.IdCategory == idCategory); - if (!filesInfoFromDb.Any()) + if (!filesInfoQuery.Any()) return null; var result = new PaginationContainer() { Skip = skip, Take = take }; if (begin != default) - filesInfoFromDb = filesInfoFromDb.Where(m => m.Date >= begin); + filesInfoQuery = filesInfoQuery.Where(m => m.Date >= begin); if (end != default) - filesInfoFromDb = filesInfoFromDb.Where(m => m.Date <= end); + filesInfoQuery = filesInfoQuery.Where(m => m.Date <= end); - result.Count = filesInfoFromDb.Count(); + result.Count = filesInfoQuery.Count(); if (skip > 0) - filesInfoFromDb = filesInfoFromDb.Skip(skip); + filesInfoQuery = filesInfoQuery.Skip(skip); - var filesInfoList = filesInfoFromDb.Take(take).ToList(); + var filesInfoList = filesInfoQuery.Take(take).ToList(); if (filesInfoList.Count == 0) return result; diff --git a/AsbCloudWebApi/Controllers/FileController.cs b/AsbCloudWebApi/Controllers/FileController.cs index 13c2e913..e4573beb 100644 --- a/AsbCloudWebApi/Controllers/FileController.cs +++ b/AsbCloudWebApi/Controllers/FileController.cs @@ -79,7 +79,7 @@ namespace AsbCloudWebApi.Controllers /// для пагинации кол-во записей взять /// Список информации о файлах в этой категории [HttpGet] - [Route("{wellId}/filesInfo")] + [Route("{wellId}")] [ProducesResponseType(typeof(PaginationContainer), (int)System.Net.HttpStatusCode.OK)] public IActionResult GetFilesInfo([FromRoute] int wellId, int skip = 0, int take = 32, int idCategory = default,