refactor(search): treat empty search strings as no filter (string.IsNullOrEmpty)
This commit is contained in:
@@ -20,7 +20,7 @@ namespace Musify.Application.Users
|
||||
.AsNoTracking()
|
||||
.AsQueryable();
|
||||
|
||||
if (request.UsernameSearch is not null)
|
||||
if (!string.IsNullOrEmpty(request.UsernameSearch))
|
||||
{
|
||||
var normalizedUsername = request.UsernameSearch.Trim().ToUpperInvariant();
|
||||
user = user.Where(u => u.NormalizedName.Contains(normalizedUsername));
|
||||
|
||||
Reference in New Issue
Block a user