Skip to content

Commit

Permalink
dynamic input fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalii-bezuhlyi committed Mar 21, 2024
1 parent 775105b commit 607fbd4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Apps.Memoq/DataSourceHandlers/UserDataHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@ public Dictionary<string, string> GetData(DataSourceContext context)
Creds);
var users = securityService.Service.ListUsers();

if (users is null)
{
return new();
}

return users
.Where(x => context.SearchString is null ||
x.FullName.Contains(context.SearchString, StringComparison.OrdinalIgnoreCase))
.Take(20)
.ToDictionary(x => x.UserGuid.ToString(), x => x.FullName);
.ToDictionary(x => x.UserGuid.ToString(), x => x.FullName ?? x.UserName);
}
}

0 comments on commit 607fbd4

Please sign in to comment.