Code Cleanup und Passwort ändern im Profil

This commit is contained in:
Andre Beging
2022-05-23 18:07:05 +02:00
parent 602799e27c
commit 45325e339c
4 changed files with 81 additions and 75 deletions

View File

@@ -1,6 +1,7 @@
using Blazorise;
using FoodsharingSiegen.Contracts.Entity;
using FoodsharingSiegen.Server.Data.Service;
using FoodsharingSiegen.Server.Dialogs;
using Microsoft.AspNetCore.Components;
namespace FoodsharingSiegen.Server.Pages
@@ -11,16 +12,25 @@ namespace FoodsharingSiegen.Server.Pages
public partial class Profile
{
#region Dependencies (Injected)
#region Dependencies (Injected)
/// <summary>
/// Gets or sets the value of the user service (ab)
/// </summary>
[Inject] public UserService? UserService { get; set; }
#endregion
#endregion
#region Private Properties
/// <summary>
/// Gets or sets the value of the password modal (ab)
/// </summary>
private SetPasswordModal? PasswordModal { get; set; }
/// <summary>
/// Gets or sets the value of the user (ab)
/// </summary>
@@ -73,6 +83,21 @@ namespace FoodsharingSiegen.Server.Pages
#endregion
#region Private Method OnPasswordSet
/// <summary>
/// Ons the password set using the specified arg (a. beging, 23.05.2022)
/// </summary>
/// <param name="arg">The arg</param>
private async Task OnPasswordSet(User arg)
{
var setPasswordR = await UserService?.SetPassword(arg)!;
if(setPasswordR.Success)
await Notification?.Success("Dein neues Passwort wurde gespeichert")!;
}
#endregion
#region Private Method RemoveAccount
/// <summary>