Skip to content

Commit

Permalink
fix(registration): fix applicationsWithStatus not showing user after …
Browse files Browse the repository at this point in the history
…decline (#873)

* fall back to all users in selection of first user if no active user is found
---------
Co-authored-by: Norbert Truchsess <[email protected]>
  • Loading branch information
dhiren-singh-007 authored Aug 6, 2024
1 parent 7a931b9 commit 76138ca
Showing 1 changed file with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,20 @@ private async Task<CompanyWithAddressData> GetCompanyWithAddressAsyncInternal(Gu
.Select(application => new
{
Application = application,
CompanyUser = application.Invitations.Select(invitation => invitation.CompanyUser)
.FirstOrDefault(companyUser =>
companyUser!.Identity!.UserStatusId == UserStatusId.ACTIVE
&& companyUser.Firstname != null
&& companyUser.Lastname != null
&& companyUser.Email != null
)
CompanyUsers = application.Invitations.Select(invitation => invitation.CompanyUser)
})
.Select(x => new
{
x.Application,
CompanyUser = x.CompanyUsers.FirstOrDefault(companyUser =>
companyUser!.Identity!.UserStatusId == UserStatusId.ACTIVE
&& companyUser!.Firstname != null
&& companyUser.Lastname != null
&& companyUser.Email != null)
?? x.CompanyUsers.FirstOrDefault(companyUser =>
companyUser!.Firstname != null
&& companyUser.Lastname != null
&& companyUser.Email != null)
})
.Select(s => new CompanyApplicationWithCompanyUserDetails(
s.Application.Id,
Expand Down

0 comments on commit 76138ca

Please sign in to comment.