Display no element and nb element (#47)
All checks were successful
Game Ideas build for PR / build_test (pull_request) Successful in 43s

This commit is contained in:
Maxime Adler
2025-05-15 14:34:55 +02:00
parent 3c3448dee0
commit 7a7863f789
13 changed files with 92 additions and 28 deletions

View File

@@ -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()
{