better ui

This commit is contained in:
didier committed 2025-01-05 19:43:30 -05:00
1 parent e0b0ca48f2
commit 84abee712d
6 files changed
+66 -17

No files matched your search

+9 -2
View File
@@ -17,9 +17,16 @@ public class ApiController: Controller
_logger = logger;
}
public JsonResult Roads(string city, int year=2025)
public ActionResult Roads(string city, string date="")
{
return Json(_dataService.GetRoads(city, year));
var extractDate = Util.ParseDateOnly(date);
if (!extractDate.HasValue)
{
return BadRequest($"Cannot parse provided date {date}. The date must be in the format yyyy-MM-dd.");
}
return Json(_dataService.GetRoads(city, extractDate.Value));
}
}