@using System.ComponentModel.DataAnnotations
@using ImageBoardServerApp.Data.Repository
@user.Email |
@user.Posts.Count Posts |
@user.Comments.Count Comments |
@user.SubmittedReports.Count Reports submitted |
@user.RecivedReports.Count Reports recived |
Edit
Update Role
@user.Role
@code {
private string selectedRole;
private bool edit = false;
[Parameter]
[Required]
public UserData user { get; set; }
protected override async Task OnInitializedAsync()
{
edit = false;
selectedRole = user.Role;
}
private async Task editF()
{
edit = !edit;
}
private async Task updateRole()
{
user.Role = selectedRole;
await UsersRepository.updateUserAsync(user);
}
}