NotificationService, MessageService

This commit is contained in:
Andre Beging
2022-05-23 11:54:05 +02:00
parent b16951a1a6
commit d8662c4876
6 changed files with 45 additions and 17 deletions

View File

@@ -18,7 +18,7 @@ namespace FoodsharingSiegen.Server.Pages
[Inject] public UserService? UserService { get; set; }
#endregion
#region Private Properties
/// <summary>
@@ -69,7 +69,15 @@ namespace FoodsharingSiegen.Server.Pages
private async Task SaveProfile()
{
var updateR = await UserService?.Update(User)!;
if (updateR.Success) await RefreshState();
if (updateR.Success)
{
await Notification?.Success("Profil gespeichert!")!;
await RefreshState();
}
else
{
await Notification?.Error(updateR.ErrorMessage)!;
}
}
#endregion