Skip to content

Commit 6cfee05

Browse files
committed
RE1-T112 PR#320 fixes
1 parent 2d0fad6 commit 6cfee05

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Web/Resgrid.Web.Services/Controllers/v4/WeatherAlertsController.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ public async Task<ActionResult<GetWeatherAlertResult>> GetWeatherAlert(string al
8989
[ProducesResponseType(StatusCodes.Status200OK)]
9090
public async Task<ActionResult<GetActiveWeatherAlertsResult>> GetAlertHistory([FromQuery] DateTime startDate, [FromQuery] DateTime endDate)
9191
{
92+
if (startDate > endDate)
93+
return BadRequest();
94+
9295
var department = await _departmentsService.GetDepartmentByIdAsync(DepartmentId, false);
9396
var alerts = await _weatherAlertService.GetAlertHistoryAsync(DepartmentId, startDate, endDate);
9497
var result = new GetActiveWeatherAlertsResult();
@@ -111,6 +114,9 @@ public async Task<ActionResult<GetActiveWeatherAlertsResult>> GetAlertHistory([F
111114
[ProducesResponseType(StatusCodes.Status200OK)]
112115
public async Task<ActionResult<GetActiveWeatherAlertsResult>> GetAlertsNearLocation([FromQuery] double lat, [FromQuery] double lng, [FromQuery] double radiusMiles = 25)
113116
{
117+
if (lat < -90 || lat > 90 || lng < -180 || lng > 180 || radiusMiles < 0 || radiusMiles > 500)
118+
return BadRequest();
119+
114120
var department = await _departmentsService.GetDepartmentByIdAsync(DepartmentId, false);
115121
var alerts = await _weatherAlertService.GetActiveAlertsNearLocationAsync(DepartmentId, lat, lng, radiusMiles);
116122
var result = new GetActiveWeatherAlertsResult();

0 commit comments

Comments
 (0)