u
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using FluentValidation;
|
||||
using FrontOffice.BFF.Package.Protobuf.Protos.Package;
|
||||
using FrontOffice.BFF.User.Protobuf.Protos.User;
|
||||
using FrontOffice.Main.Utilities;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MudBlazor;
|
||||
@@ -9,7 +11,9 @@ namespace FrontOffice.Main.Pages.Profile;
|
||||
|
||||
public partial class Index
|
||||
{
|
||||
private UserProfile _userProfile = new();
|
||||
[Inject] private UserContract.UserContractClient UserContract { get; set; } = default!;
|
||||
|
||||
private GetUserResponse _userProfile = new();
|
||||
private PasswordChangeModel _passwordModel = new();
|
||||
private AccountSettings _settings = new();
|
||||
|
||||
@@ -23,29 +27,20 @@ public partial class Index
|
||||
private readonly UserProfileValidator _personalValidator = new();
|
||||
private readonly PasswordChangeValidator _passwordValidator = new();
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
await LoadUserProfile();
|
||||
await LoadAccountSettings();
|
||||
await base.OnAfterRenderAsync(firstRender);
|
||||
if(firstRender)
|
||||
{
|
||||
await LoadUserProfile();
|
||||
await LoadAccountSettings();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task LoadUserProfile()
|
||||
{
|
||||
// TODO: Load user profile from API
|
||||
_userProfile = new UserProfile
|
||||
{
|
||||
FirstName = "علی",
|
||||
LastName = "احمدی",
|
||||
Email = "ali.ahmad@example.com",
|
||||
PhoneNumber = "09123456789",
|
||||
NationalCode = "0123456789",
|
||||
BirthDate = "1370/01/01",
|
||||
Address = "تهران، خیابان ولیعصر",
|
||||
JoinDate = "۱۴۰۲/۰۱/۱۵",
|
||||
LastLogin = "۱۴۰۲/۱۰/۰۶",
|
||||
TotalReferrals = 25,
|
||||
Level = "طلایی"
|
||||
};
|
||||
_userProfile = await UserContract.GetUserAsync(request: new());
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private async Task LoadAccountSettings()
|
||||
|
||||
Reference in New Issue
Block a user