From 2e27b7801fce781839a0e3efa24987e0ad679b01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Chirico=20Indreb=C3=B8?= Date: Tue, 20 Feb 2024 17:32:01 +0100 Subject: [PATCH] Make desiredstartime optional in frontend --- backend/api/Controllers/MissionSchedulingController.cs | 2 +- backend/api/Controllers/Models/ScheduledMissionQuery.cs | 2 +- frontend/src/api/ApiCaller.tsx | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/api/Controllers/MissionSchedulingController.cs b/backend/api/Controllers/MissionSchedulingController.cs index 47ed547fa..9691db741 100644 --- a/backend/api/Controllers/MissionSchedulingController.cs +++ b/backend/api/Controllers/MissionSchedulingController.cs @@ -316,7 +316,7 @@ [FromBody] ScheduledMissionQuery scheduledMissionQuery MissionId = scheduledMissionDefinition.Id, Status = MissionStatus.Pending, MissionRunPriority = MissionRunPriority.Normal, - DesiredStartTime = scheduledMissionQuery.DesiredStartTime, + DesiredStartTime = scheduledMissionQuery.DesiredStartTime ?? DateTime.UtcNow, Tasks = missionTasks, InstallationCode = scheduledMissionQuery.InstallationCode, Area = area, diff --git a/backend/api/Controllers/Models/ScheduledMissionQuery.cs b/backend/api/Controllers/Models/ScheduledMissionQuery.cs index 3fae55b4e..7d0c4b09a 100644 --- a/backend/api/Controllers/Models/ScheduledMissionQuery.cs +++ b/backend/api/Controllers/Models/ScheduledMissionQuery.cs @@ -4,7 +4,7 @@ public struct ScheduledMissionQuery { public string RobotId { get; set; } public int EchoMissionId { get; set; } - public DateTime DesiredStartTime { get; set; } + public DateTime? DesiredStartTime { get; set; } public string InstallationCode { get; set; } public string? AreaName { get; set; } public TimeSpan? InspectionFrequency { get; set; } diff --git a/frontend/src/api/ApiCaller.tsx b/frontend/src/api/ApiCaller.tsx index f0478c4e4..e6f50e210 100644 --- a/frontend/src/api/ApiCaller.tsx +++ b/frontend/src/api/ApiCaller.tsx @@ -306,7 +306,6 @@ export class BackendAPICaller { const body = { robotId: desiredRobot[0].id, echoMissionId: echoMissionId, - desiredStartTime: new Date(), installationCode: installationCode, areaName: '', }