Skip to content

Commit

Permalink
Date filtering was broken, so I removed it.
Browse files Browse the repository at this point in the history
  • Loading branch information
Simyon264 committed Mar 2, 2024
1 parent 793e8ff commit e10c8b3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Server/Api/ReplayController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,16 @@ public async Task<ActionResult> GetAllReplays()
}

/// <summary>
/// Returns the most recent replays.
/// Returns the most recent replays. Not sorted by date. Just the most recent replays stored in the database.
/// </summary>
[HttpGet]
[Route("/replays/most-recent")]
public async Task<ActionResult> GetMostRecentReplay()
{
var replays = await _context.Replays
.OrderByDescending(r => r.Id)
.Take(32)
.ToListAsync();

// Order by most recent
replays = replays.OrderByDescending(r => r.Date ?? DateTime.MinValue).ToList();
return Ok(replays);
}

Expand Down

0 comments on commit e10c8b3

Please sign in to comment.