From 6107de3e53243bc178280d031901288125efc1b7 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Sun, 27 Sep 2026 14:16:08 +0200 Subject: [PATCH] fixed new change request logic --- .../Services/Projects/ProjectService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PostFundManagement.Application/Services/Projects/ProjectService.cs b/PostFundManagement.Application/Services/Projects/ProjectService.cs index f37bb77..77fef60 100644 --- a/PostFundManagement.Application/Services/Projects/ProjectService.cs +++ b/PostFundManagement.Application/Services/Projects/ProjectService.cs @@ -388,7 +388,7 @@ public sealed class ProjectService(IDbContextFactory conte { await using var context = await contextFactory.CreateDbContextAsync(cancellationToken); - if (await context.Projects.AnyAsync(p => p.Id == request.ProjectId, cancellationToken)) + if (!await context.Projects.AnyAsync(p => p.Id == request.ProjectId, cancellationToken)) return Result.Fail(ValidationError.Create("Project does not exist")); context.ChangeRequests.Add(new Domain.Entities.ChangeRequest @@ -465,7 +465,7 @@ public sealed class ProjectService(IDbContextFactory conte { await using var context = await contextFactory.CreateDbContextAsync(cancellationToken); - if (await context.Projects.AnyAsync(p => p.Id == request.ProjectId, cancellationToken)) + if (!await context.Projects.AnyAsync(p => p.Id == request.ProjectId, cancellationToken)) return Result.Fail(ValidationError.Create("Project does not exist")); context.ComplianceItems.Add(new Domain.Entities.ComplianceItem