Implemented member management of roles. Moved users controller

This commit is contained in:
2026-01-15 14:52:29 +01:00
parent fcaa0dcd07
commit 10cd0f0b09
6 changed files with 320 additions and 16 deletions

View File

@@ -32,7 +32,7 @@
</div>
</div>
<div class="mt-8">
<div class="mt-3">
<DataGrid @ref="Grid" TGridItem="UserDto" Loader="LoadAsync" PageSize="10" ClassName="bg-card">
<PropertyColumn HeadClassName="text-left" CellClassName="text-left" Field="u => u.Id"/>
<PropertyColumn HeadClassName="text-left" CellClassName="text-left" IsFilterable="true"
@@ -83,7 +83,7 @@
var filterOptions = request.Filters.Count > 0 ? new FilterOptions(request.Filters) : null;
var response = await HttpClient.GetFromJsonAsync<PagedData<UserDto>>(
$"api/users{query}&filterOptions={filterOptions}",
$"api/admin/users{query}&filterOptions={filterOptions}",
Constants.SerializerOptions
);
@@ -97,7 +97,7 @@
parameters[nameof(CreateUserDialog.OnSubmit)] = async (CreateUserDto dto) =>
{
await HttpClient.PostAsJsonAsync(
"/api/users",
"/api/admin/users",
dto,
Constants.SerializerOptions
);
@@ -120,7 +120,7 @@
parameters[nameof(CreateUserDialog.OnSubmit)] = async (UpdateUserDto dto) =>
{
await HttpClient.PatchAsJsonAsync(
$"/api/users/{user.Id}",
$"/api/admin/users/{user.Id}",
dto
);
@@ -141,7 +141,7 @@
"Do you really want to delete this user? This action cannot be undone",
async () =>
{
await HttpClient.DeleteAsync($"api/users/{user.Id}");
await HttpClient.DeleteAsync($"api/admin/users/{user.Id}");
await ToastService.SuccessAsync("User deletion", $"Successfully deleted user {user.Username}");
await Grid.RefreshAsync();