Skip to content

Commit c341704

Browse files
committed
Remove mappers
1 parent fc100c8 commit c341704

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/ECER.Managers.Registry/ApplicationHandlers.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,10 @@ public class ApplicationHandlers(
6363
}
6464
}, cancellationToken);
6565

66-
var draftApplicationResults = new ApplicationsQueryResults(mapper.Map<IEnumerable<Contract.Applications.Application>>(applications)!);
67-
var existingDraftApplication = draftApplicationResults.Items.FirstOrDefault();
68-
if (existingDraftApplication != null)
66+
if (applications.Any())
6967
{
7068
// user already has a draft application
71-
throw new InvalidOperationException($"User already has an application in progress with id '{existingDraftApplication.Id}'");
69+
throw new InvalidOperationException($"User already has an application in progress with id '{applications.SingleOrDefault()!.Id}'");
7270
}
7371
}
7472
request.Application.Origin = Contract.Applications.ApplicationOrigin.Portal; // Set application origin to "Portal"

0 commit comments

Comments
 (0)