From 37390fa1c81d9034e66d8ae3f2f89d06e35d63f3 Mon Sep 17 00:00:00 2001 From: Mikhail Kuznetsov Date: Tue, 20 Jun 2023 13:51:00 +1000 Subject: [PATCH] fix Syncher whitespace --- PARR.AIHIT/AIHIT/Syncher.cs | 2 +- PARR.API/Contracts/V1/Responses/JobResponse.cs | 1 + PARR.API/Controllers/V1/JobController.cs | 6 ++---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/PARR.AIHIT/AIHIT/Syncher.cs b/PARR.AIHIT/AIHIT/Syncher.cs index 08ea8fb0..664aa55e 100644 --- a/PARR.AIHIT/AIHIT/Syncher.cs +++ b/PARR.AIHIT/AIHIT/Syncher.cs @@ -332,7 +332,7 @@ namespace PARR.AIHIT private async Task CreateAppIfNotExistAsync(string appName, ApplicationTypesEnum type)//Application application) { - if (string.IsNullOrEmpty(appName)) return null; + if (string.IsNullOrEmpty(appName) || string.IsNullOrWhiteSpace(appName)) return null; var existApp = await appService.GetByNameAsync(appName); if (existApp != null) diff --git a/PARR.API/Contracts/V1/Responses/JobResponse.cs b/PARR.API/Contracts/V1/Responses/JobResponse.cs index 508a7336..97927ba3 100644 --- a/PARR.API/Contracts/V1/Responses/JobResponse.cs +++ b/PARR.API/Contracts/V1/Responses/JobResponse.cs @@ -6,6 +6,7 @@ public DateTimeOffset StartAt { get; set; } public int FrequencyMinute { get; set; } public required JobModeResponse JobMode { get; set; } + public required string ScriptName { get; set; } } public class JobGetAllResponse : JobBaseResponse diff --git a/PARR.API/Controllers/V1/JobController.cs b/PARR.API/Controllers/V1/JobController.cs index 9e5b1610..f7445c29 100644 --- a/PARR.API/Controllers/V1/JobController.cs +++ b/PARR.API/Controllers/V1/JobController.cs @@ -101,13 +101,11 @@ namespace PARR.API.Controllers.V1 jobsJoined.Add(item); }); } - jobsJoined.Distinct(); - if (!jobsJoined.Any()) return NoContent(); - - var jobResponse = mapper.Map>(jobsJoined); + + var jobResponse = mapper.Map>(jobsJoined.Distinct()); return Ok(new Response>(jobResponse, true, new List(), $"{ip},{date}")); }