[frontend/api] Make GetDisplayNameAsync not nullable

This commit is contained in:
pancakes 2024-11-28 00:03:23 +10:00 committed by Laura Hausmann
parent 482172b8e9
commit 93fd573ca6
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
2 changed files with 3 additions and 3 deletions

View file

@ -11,8 +11,8 @@ internal class ProfileControllerModel(ApiClient api)
public Task UpdateProfileAsync(UserProfileEntity request) =>
api.CallAsync(HttpMethod.Put, "/profile", data: request);
public Task<string?> GetDisplayNameAsync() =>
api.CallNullableAsync<string>(HttpMethod.Get, "/profile/display_name");
public Task<string> GetDisplayNameAsync() =>
api.CallAsync<string>(HttpMethod.Get, "/profile/display_name");
public Task<string?> UpdateDisplayNameAsync(string displayName) =>
api.CallNullableAsync<string>(HttpMethod.Post, "/profile/display_name", data: displayName);

View file

@ -95,7 +95,7 @@
{
UserProfile = await Api.Profile.GetProfileAsync();
State = State.Loaded;
DisplayName = await Api.Profile.GetDisplayNameAsync() ?? "";
DisplayName = await Api.Profile.GetDisplayNameAsync();
}
catch (ApiException e)
{