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