diff --git a/AsbCloudWebApi/Controllers/ReportController.cs b/AsbCloudWebApi/Controllers/ReportController.cs index c9f0c8d9..ebd6a690 100644 --- a/AsbCloudWebApi/Controllers/ReportController.cs +++ b/AsbCloudWebApi/Controllers/ReportController.cs @@ -133,6 +133,7 @@ namespace AsbCloudWebApi.Controllers [HttpGet("datesRange")] [Permission] [ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)] + [ProducesResponseType((int)System.Net.HttpStatusCode.NoContent)] public async Task GetReportsDateRangeAsync(int idWell, CancellationToken token) { int? idCompany = User.GetCompanyId(); @@ -146,6 +147,9 @@ namespace AsbCloudWebApi.Controllers var wellReportsDatesRange = reportService.GetDatesRangeOrDefault(idWell); + if (wellReportsDatesRange is null) + return NoContent(); + return Ok(wellReportsDatesRange); } } diff --git a/AsbCloudWebApi/Controllers/SAUB/TelemetryDataBaseController.cs b/AsbCloudWebApi/Controllers/SAUB/TelemetryDataBaseController.cs index 57a97043..4c8ec124 100644 --- a/AsbCloudWebApi/Controllers/SAUB/TelemetryDataBaseController.cs +++ b/AsbCloudWebApi/Controllers/SAUB/TelemetryDataBaseController.cs @@ -139,6 +139,7 @@ namespace AsbCloudWebApi.Controllers.SAUB [HttpGet("{idWell}/dateRange")] [ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)] [ProducesResponseType((int)System.Net.HttpStatusCode.NotFound)] + [ProducesResponseType((int)System.Net.HttpStatusCode.NoContent)] public virtual async Task> GetRangeAsync( [FromRoute] int idWell, [Required] DateTimeOffset geDate, @@ -158,6 +159,9 @@ namespace AsbCloudWebApi.Controllers.SAUB var content = await telemetryDataService.GetRangeAsync(idWell, geDate, leDate, token); + if (content is null) + return NoContent(); + return Ok(content); } @@ -171,6 +175,7 @@ namespace AsbCloudWebApi.Controllers.SAUB [Permission] [ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)] [ProducesResponseType((int)System.Net.HttpStatusCode.NotFound)] + [ProducesResponseType((int)System.Net.HttpStatusCode.NoContent)] public virtual async Task> GetDataDatesRangeAsync(int idWell, CancellationToken token) {