fixed new change request logic #112
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user