[frontend/api] Make GetDisplayNameAsync not nullable
This commit is contained in:
parent
482172b8e9
commit
93fd573ca6
2 changed files with 3 additions and 3 deletions
|
@ -11,8 +11,8 @@ internal class ProfileControllerModel(ApiClient api)
|
||||||
public Task UpdateProfileAsync(UserProfileEntity request) =>
|
public Task UpdateProfileAsync(UserProfileEntity request) =>
|
||||||
api.CallAsync(HttpMethod.Put, "/profile", data: request);
|
api.CallAsync(HttpMethod.Put, "/profile", data: request);
|
||||||
|
|
||||||
public Task<string?> GetDisplayNameAsync() =>
|
public Task<string> GetDisplayNameAsync() =>
|
||||||
api.CallNullableAsync<string>(HttpMethod.Get, "/profile/display_name");
|
api.CallAsync<string>(HttpMethod.Get, "/profile/display_name");
|
||||||
|
|
||||||
public Task<string?> UpdateDisplayNameAsync(string displayName) =>
|
public Task<string?> UpdateDisplayNameAsync(string displayName) =>
|
||||||
api.CallNullableAsync<string>(HttpMethod.Post, "/profile/display_name", data: displayName);
|
api.CallNullableAsync<string>(HttpMethod.Post, "/profile/display_name", data: displayName);
|
||||||
|
|
|
@ -95,7 +95,7 @@
|
||||||
{
|
{
|
||||||
UserProfile = await Api.Profile.GetProfileAsync();
|
UserProfile = await Api.Profile.GetProfileAsync();
|
||||||
State = State.Loaded;
|
State = State.Loaded;
|
||||||
DisplayName = await Api.Profile.GetDisplayNameAsync() ?? "";
|
DisplayName = await Api.Profile.GetDisplayNameAsync();
|
||||||
}
|
}
|
||||||
catch (ApiException e)
|
catch (ApiException e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue