From 8930e88c0e746069301d912d310c165583b85d1c Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Tue, 19 Nov 2024 12:57:45 +0700 Subject: [PATCH] Fix failing test where user couldn't see himself --- backend/LexBoxApi/Services/UserService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/LexBoxApi/Services/UserService.cs b/backend/LexBoxApi/Services/UserService.cs index 028e4692e..dc3f3a29f 100644 --- a/backend/LexBoxApi/Services/UserService.cs +++ b/backend/LexBoxApi/Services/UserService.cs @@ -91,6 +91,7 @@ public IQueryable UserQueryForTypeahead(LexAuthUser user) var myProjectIds = user.Projects.Select(p => p.ProjectId).ToList(); var myManagedProjectIds = user.Projects.Where(p => p.Role == ProjectRole.Manager).Select(p => p.ProjectId).ToList(); return dbContext.Users.Where(u => + u.Id == user.Id || u.Organizations.Any(orgMember => myOrgIds.Contains(orgMember.OrgId)) || u.Projects.Any(projMember => myManagedProjectIds.Contains(projMember.ProjectId) ||