Fix gitea issues (#54)
All checks were successful
Game Ideas deploy / build-test-deploy (push) Successful in 1m16s
All checks were successful
Game Ideas deploy / build-test-deploy (push) Successful in 1m16s
Co-authored-by: Maxime Adler <madler@sqli.com> Reviewed-on: #54
This commit was merged in pull request #54.
This commit is contained in:
@@ -36,18 +36,17 @@ 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 = true;
|
||||
|
||||
if (fetchRoles)
|
||||
Roles = await UserGateway.GetRoles();
|
||||
IsLoading = displayLoading;
|
||||
StateHasChanged();
|
||||
|
||||
UserList = await UserGateway.GetUsers(FilterParams, CurrentPage);
|
||||
}
|
||||
@@ -58,6 +57,27 @@ public partial class Users
|
||||
finally
|
||||
{
|
||||
IsLoading = false;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task FetchRoles()
|
||||
{
|
||||
try
|
||||
{
|
||||
IsLoading = true;
|
||||
StateHasChanged();
|
||||
|
||||
Roles = await UserGateway.GetRoles();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
IsLoading = false;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,9 +86,10 @@ public partial class Users
|
||||
try
|
||||
{
|
||||
IsLoading = true;
|
||||
StateHasChanged();
|
||||
|
||||
await UserGateway.CreateUser(user);
|
||||
await FetchData(false);
|
||||
await FetchUsers();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -77,9 +98,9 @@ public partial class Users
|
||||
finally
|
||||
{
|
||||
IsLoading = false;
|
||||
StateHasChanged();
|
||||
UserAdd = new();
|
||||
}
|
||||
|
||||
UserAdd = new();
|
||||
}
|
||||
|
||||
private async Task HandleUpdateUser(UserDto user)
|
||||
@@ -87,9 +108,10 @@ public partial class Users
|
||||
try
|
||||
{
|
||||
IsLoading = true;
|
||||
StateHasChanged();
|
||||
|
||||
await UserGateway.UpdateUser(user);
|
||||
await FetchData(false);
|
||||
await FetchUsers();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -98,6 +120,7 @@ public partial class Users
|
||||
finally
|
||||
{
|
||||
IsLoading = false;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,9 +136,10 @@ public partial class Users
|
||||
try
|
||||
{
|
||||
IsLoading = true;
|
||||
StateHasChanged();
|
||||
|
||||
await UserGateway.DeleteUser(UserDelete.Id);
|
||||
await FetchData(false);
|
||||
await FetchUsers();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -124,6 +148,7 @@ public partial class Users
|
||||
finally
|
||||
{
|
||||
IsLoading = false;
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
UserDelete = null;
|
||||
@@ -134,7 +159,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