better ui
This commit is contained in:
1 parent
e0b0ca48f2
commit
84abee712d
6 files changed
+66
-17
No files matched your search
@@ -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));
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user