2 Commits
Author SHA1 Message Date
khwezi 5e25fd7a11 Merge pull request 'fixed new change request logic' (#112) from finishline into main
Reviewed-on: #112
2026-09-27 14:16:31 +02:00
hermes 6107de3e53 fixed new change request logic 2026-09-27 14:16:08 +02:00
@@ -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