From dc08285ec8ab100ead9011c5c84ffbd802498980 Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Sun, 2 Feb 2025 20:31:52 +0300 Subject: [PATCH] feat: clear old records --- .../V1/Configuration/ScheduleController.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Endpoint/Controllers/V1/Configuration/ScheduleController.cs b/Endpoint/Controllers/V1/Configuration/ScheduleController.cs index 6327a01..b841b9f 100644 --- a/Endpoint/Controllers/V1/Configuration/ScheduleController.cs +++ b/Endpoint/Controllers/V1/Configuration/ScheduleController.cs @@ -102,10 +102,18 @@ public class ScheduleController(ILogger logger, IOptionsSnap /// /// Cron update skip dates. [HttpGet("CronUpdateSkip")] - public ActionResult> CronUpdateSkip() => - config.Value.ScheduleSettings!.CronUpdateSkipDateList - .Filter() + public ActionResult> CronUpdateSkip() + { + var generalConfig = config.Value; + + generalConfig.ScheduleSettings!.CronUpdateSkipDateList = + generalConfig.ScheduleSettings.CronUpdateSkipDateList.Filter(); + generalConfig.SaveSetting(); + + return generalConfig.ScheduleSettings!.CronUpdateSkipDateList .ConvertToDto(); + } + /// /// Updates the list of cron update skip dates in the configuration.