From 1c6301242d6a9ad43717e3c5e436af17c40263cc Mon Sep 17 00:00:00 2001 From: "DESKTOP-T0O5CDB\\DESK-555BD" Date: Wed, 22 Jan 2025 12:07:03 -0700 Subject: [PATCH] make urgencies endpoint parameters optional. --- Controllers/APIController.cs | 5 +++++ Views/API/Index.cshtml | 12 ++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Controllers/APIController.cs b/Controllers/APIController.cs index c909472..02dd32c 100644 --- a/Controllers/APIController.cs +++ b/Controllers/APIController.cs @@ -1232,6 +1232,11 @@ namespace CarCareTracker.Controllers [Route("/api/vehicle/reminders/send")] public IActionResult SendReminders(List urgencies) { + if (!urgencies.Any()) + { + //if no urgencies parameter, we will default to all urgencies. + urgencies = new List { ReminderUrgency.NotUrgent, ReminderUrgency.Urgent, ReminderUrgency.VeryUrgent, ReminderUrgency.PastDue }; + } var vehicles = _dataAccess.GetVehicles(); List operationResponses = new List(); var defaultEmailAddress = _config.GetUserConfig(User).DefaultReminderEmail; diff --git a/Views/API/Index.cshtml b/Views/API/Index.cshtml index 1e9a72f..99d3126 100644 --- a/Views/API/Index.cshtml +++ b/Views/API/Index.cshtml @@ -614,7 +614,7 @@
GET
-
+
/api/vehicle/reminders/send
@@ -622,7 +622,7 @@
(must be root user)
- urgencies[]=[NotUrgent,Urgent,VeryUrgent,PastDue] + urgencies[]=[NotUrgent,Urgent,VeryUrgent,PastDue](optional)
@@ -651,7 +651,7 @@
(must be root user)
- deepClean(bool) - Perform deep clean + deepClean(bool) - Perform deep clean(optional)
} @@ -660,11 +660,7 @@ if (e.ctrlKey || e.metaKey){ let targetElement = $(e.currentTarget); if (targetElement.hasClass("testable")){ - if (targetElement.attr("data-testparam")){ - window.location = `${targetElement.text().trim()}${targetElement.attr("data-testparam")}`; - } else { - window.location = targetElement.text().trim(); - } + window.location = targetElement.text().trim(); } } else { copyToClipboard(e.currentTarget);