Skip to content

Commit

Permalink
Added GetNewCrashReports
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Oct 6, 2023
1 parent abd363b commit f3dafef
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/BUTR.CrashReportServer/Controllers/ReportController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,19 @@ public ActionResult<IEnumerable<FileMetadata>> GetFilenameDates(ICollection<stri
.AsAsyncEnumerable()
.Select(x => new FileMetadata(x.FileId, x.CrashReportId, x.Version, x.Created.ToUniversalTime())));
}

[Authorize]
[HttpGet("GetNewCrashReports")]
[ProducesResponseType(typeof(FileMetadata[]), StatusCodes.Status200OK, "application/json")]
[ProducesResponseType(typeof(void), StatusCodes.Status500InternalServerError, "application/problem+json")]
[ProducesResponseType(typeof(TLSError), StatusCodes.Status400BadRequest, "application/json")]
[HttpsProtocol(Protocol = SslProtocols.Tls13)]
public ActionResult<IEnumerable<FileMetadata>> GetNewCrashReportsDates([FromQuery] DateTime date, CancellationToken ct)
{
return Ok(_dbContext.Set<IdEntity>()
.Where(x => x.Created >= date)
.Select(x => new { x.FileId, x.CrashReportId, x.Version, x.Created })
.AsAsyncEnumerable()
.Select(x => new FileMetadata(x.FileId, x.CrashReportId, x.Version, x.Created.ToUniversalTime())));
}
}

0 comments on commit f3dafef

Please sign in to comment.