Fix history cursor parsing build
This commit is contained in:
@@ -44,10 +44,12 @@ public class ExamSimulationsController(ExamSimulationStore simulations) : Contro
|
|||||||
public async Task<IActionResult> Completed([FromQuery] int limit = 20, [FromQuery] string? before = null)
|
public async Task<IActionResult> Completed([FromQuery] int limit = 20, [FromQuery] string? before = null)
|
||||||
{
|
{
|
||||||
DateTime? cursor = null;
|
DateTime? cursor = null;
|
||||||
if (!string.IsNullOrWhiteSpace(before) && !DateTime.TryParse(before, null, System.Globalization.DateTimeStyles.RoundtripKind, out var parsed))
|
if (!string.IsNullOrWhiteSpace(before))
|
||||||
return BadRequest("The completed-simulation cursor is invalid.");
|
{
|
||||||
else if (!string.IsNullOrWhiteSpace(before))
|
if (!DateTime.TryParse(before, null, System.Globalization.DateTimeStyles.RoundtripKind, out var parsed))
|
||||||
|
return BadRequest("The completed-simulation cursor is invalid.");
|
||||||
cursor = parsed;
|
cursor = parsed;
|
||||||
|
}
|
||||||
return Ok(await simulations.GetCompletedAsync(UserId(), limit, cursor));
|
return Ok(await simulations.GetCompletedAsync(UserId(), limit, cursor));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user