Display no element and nb element (#47)
All checks were successful
Game Ideas build for PR / build_test (pull_request) Successful in 43s
All checks were successful
Game Ideas build for PR / build_test (pull_request) Successful in 43s
This commit is contained in:
@@ -36,20 +36,36 @@ public partial class Users
|
||||
}
|
||||
|
||||
|
||||
await FetchData();
|
||||
await FetchUsers();
|
||||
await FetchRoles();
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
private async Task FetchData(bool fetchRoles = true)
|
||||
private async Task FetchUsers(bool displayLoading = true)
|
||||
{
|
||||
try
|
||||
{
|
||||
IsLoading = displayLoading;
|
||||
|
||||
UserList = await UserGateway.GetUsers(FilterParams, CurrentPage);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
IsLoading = false;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task FetchRoles()
|
||||
{
|
||||
try
|
||||
{
|
||||
IsLoading = true;
|
||||
|
||||
if (fetchRoles)
|
||||
Roles = await UserGateway.GetRoles();
|
||||
|
||||
UserList = await UserGateway.GetUsers(FilterParams, CurrentPage);
|
||||
Roles = await UserGateway.GetRoles();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -68,7 +84,7 @@ public partial class Users
|
||||
IsLoading = true;
|
||||
|
||||
await UserGateway.CreateUser(user);
|
||||
await FetchData(false);
|
||||
await FetchUsers();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -89,7 +105,7 @@ public partial class Users
|
||||
IsLoading = true;
|
||||
|
||||
await UserGateway.UpdateUser(user);
|
||||
await FetchData(false);
|
||||
await FetchUsers();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -115,7 +131,7 @@ public partial class Users
|
||||
IsLoading = true;
|
||||
|
||||
await UserGateway.DeleteUser(UserDelete.Id);
|
||||
await FetchData(false);
|
||||
await FetchUsers();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -134,7 +150,7 @@ public partial class Users
|
||||
}
|
||||
private async Task HandleFilterChanged()
|
||||
{
|
||||
await FetchData(false);
|
||||
await FetchUsers(false);
|
||||
}
|
||||
private void HandleCancelPopupClicked()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user