refactor(search): treat empty search strings as no filter (string.IsNullOrEmpty)

This commit is contained in:
2026-07-06 02:12:58 +02:00
parent 7f439b168b
commit 1769df12d5
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -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));