Compare commits
No commits in common. "1ca64702d7a79e6e598998ad31433cde06d0c3cc" and "fb3705690d0d7075386517a80d66cbd92d2ec53e" have entirely different histories.
1ca64702d7
...
fb3705690d
@ -45,19 +45,8 @@ namespace Api.Controllers
|
|||||||
// Sends the deviceId to deviceLogic
|
// Sends the deviceId to deviceLogic
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[HttpGet("logs/{deviceId}")]
|
[HttpGet("logs/{deviceId}")]
|
||||||
public async Task<IActionResult> GetLogs(int deviceId, DateTime? dateTimeStart = null, DateTime? dateTimeEnd = null)
|
public async Task<IActionResult> GetLogs([FromBody] DateTimeRange dateTimeRange, int deviceId)
|
||||||
{
|
{
|
||||||
DateTimeRange dateTimeRange = new DateTimeRange();
|
|
||||||
if (dateTimeStart != null && dateTimeEnd != null)
|
|
||||||
{
|
|
||||||
dateTimeRange.DateTimeStart = (DateTime)dateTimeStart;
|
|
||||||
dateTimeRange.DateTimeEnd= (DateTime)dateTimeEnd;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dateTimeRange.DateTimeStart = DateTime.Now;
|
|
||||||
dateTimeRange.DateTimeEnd = dateTimeRange.DateTimeStart;
|
|
||||||
}
|
|
||||||
return await _deviceLogic.GetLogs(dateTimeRange, deviceId);
|
return await _deviceLogic.GetLogs(dateTimeRange, deviceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user