[backend/api] Improve emoji alias update algorithm

This commit is contained in:
Laura Hausmann 2025-02-17 19:47:29 +01:00
parent a143ac8b50
commit ca786026c2
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -239,10 +239,7 @@ public partial class EmojiService(
} }
if (aliases != null) if (aliases != null)
{ emoji.Aliases = aliases.Select(p => p.Trim()).Where(p => !string.IsNullOrWhiteSpace(p)).ToList();
aliases.RemoveAll(string.IsNullOrWhiteSpace);
emoji.Aliases = aliases;
}
// If category is provided but empty reset to null // If category is provided but empty reset to null
if (category != null) emoji.Category = string.IsNullOrEmpty(category) ? null : category; if (category != null) emoji.Category = string.IsNullOrEmpty(category) ? null : category;