better ui
This commit is contained in:
1 parent
e0b0ca48f2
commit
84abee712d
6 files changed
+66
-17
No files matched your search
@@ -5,7 +5,7 @@ using YongeStreet.Services;
|
||||
|
||||
namespace YongeStreet.Controllers;
|
||||
|
||||
public record CityModel(string City, IList<CityRoadLengthStats> CityRoadLengthStats);
|
||||
public record CityModel(string City, IList<CityRoadLengthStats> CityRoadLengthStats, DateOnly Date);
|
||||
|
||||
public record IndexModel(IList<CityOverview> Cities);
|
||||
|
||||
@@ -20,10 +20,11 @@ public class HomeController : Controller
|
||||
_dataService = dataService;
|
||||
}
|
||||
|
||||
public IActionResult City(string city)
|
||||
public IActionResult City(string city, string date)
|
||||
{
|
||||
var cityRoadLengthStats = _dataService.GetCityRoadLengthStats(city);
|
||||
return View(new CityModel(city, cityRoadLengthStats));
|
||||
var parsedDate = Util.ParseDateOnly(date) ?? new DateOnly(2025, 1, 1);
|
||||
return View(new CityModel(city, cityRoadLengthStats, parsedDate ));
|
||||
}
|
||||
|
||||
public IActionResult Index()
|
||||
|
||||
Reference in new issue
Block a user