fixed new change request logic

This commit is contained in:
2026-09-27 14:16:08 +02:00
parent df167caf55
commit 6107de3e53
@@ -388,7 +388,7 @@ public sealed class ProjectService(IDbContextFactory<ApplicationDbContext> 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<ApplicationDbContext> 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