Move simulation history into profile
This commit is contained in:
@@ -53,6 +53,19 @@ public class ExamSimulationsController(ExamSimulationStore simulations) : Contro
|
||||
return Ok(await simulations.GetCompletedAsync(UserId(), limit, cursor));
|
||||
}
|
||||
|
||||
[HttpGet("history")]
|
||||
public async Task<IActionResult> History([FromQuery] int limit = 20, [FromQuery] string? before = null)
|
||||
{
|
||||
DateTime? cursor = null;
|
||||
if (!string.IsNullOrWhiteSpace(before))
|
||||
{
|
||||
if (!DateTime.TryParse(before, null, System.Globalization.DateTimeStyles.RoundtripKind, out var parsed))
|
||||
return BadRequest("The simulation-history cursor is invalid.");
|
||||
cursor = parsed;
|
||||
}
|
||||
return Ok(await simulations.GetHistoryAsync(UserId(), limit, cursor));
|
||||
}
|
||||
|
||||
[HttpGet("{id}")]
|
||||
public async Task<IActionResult> Get(string id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user