[backend/api] Set pronouns to null if new pronouns value is empty

This commit is contained in:
pancakes 2025-03-29 21:52:57 +10:00
parent 752dccd21e
commit 70602a8934
No known key found for this signature in database

View file

@ -76,7 +76,7 @@ public class ProfileController(
profile.Birthday = birthday; profile.Birthday = birthday;
profile.Fields = fields.ToArray(); profile.Fields = fields.ToArray();
profile.FFVisibility = (UserProfile.UserProfileFFVisibility)newProfile.FFVisibility; profile.FFVisibility = (UserProfile.UserProfileFFVisibility)newProfile.FFVisibility;
profile.Pronouns = newProfile.Pronouns; profile.Pronouns = newProfile.Pronouns.Count != 0 ? newProfile.Pronouns : null;
user.DisplayName = string.IsNullOrWhiteSpace(newProfile.DisplayName) ? null : newProfile.DisplayName.Trim(); user.DisplayName = string.IsNullOrWhiteSpace(newProfile.DisplayName) ? null : newProfile.DisplayName.Trim();