From d9205d425c5aa30e0e0e56ed7fc0d5617cdd3e87 Mon Sep 17 00:00:00 2001 From: Jeas0001 Date: Mon, 31 Mar 2025 10:48:20 +0200 Subject: [PATCH] Datetime ranged have any logs --- backend/Api/BusinessLogic/DeviceLogic.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/Api/BusinessLogic/DeviceLogic.cs b/backend/Api/BusinessLogic/DeviceLogic.cs index ae4be2c..4f0eb50 100644 --- a/backend/Api/BusinessLogic/DeviceLogic.cs +++ b/backend/Api/BusinessLogic/DeviceLogic.cs @@ -76,6 +76,8 @@ namespace Api.BusinessLogic if (log.Date <= dateTimeRange.DateTimeStart && log.Date >= dateTimeRange.DateTimeEnd) { rangedLogs.Add(log); } } + if (rangedLogs.Count == 0) { return new ConflictObjectResult(new { message = "There is no logs for that periode" }); } + return new OkObjectResult(rangedLogs); }