Skip to content

Commit

Permalink
Merge pull request #10 from davewalker5/DFL-2-Sort-Locations
Browse files Browse the repository at this point in the history
Order locations alphabetically for the UI
  • Loading branch information
davewalker5 authored Oct 30, 2023
2 parents 293679b + f7db51a commit e1be483
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/DroneFlightLog.Api/Controllers/LocationsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ public LocationsController(IDroneFlightLogFactory<DroneFlightLogDbContext> facto
[Route("")]
public async Task<ActionResult<List<Location>>> GetLocationsAsync()
{
List<Location> locations = await _factory.Locations.GetLocationsAsync().ToListAsync();
List<Location> locations = await _factory.Locations
.GetLocationsAsync()
.OrderBy(x => x.Name)
.ToListAsync();

if (!locations.Any())
{
Expand Down

0 comments on commit e1be483

Please sign in to comment.