Implemented handling of server side issues using the rfc for problem detasils in the frontend

This commit is contained in:
2026-01-29 09:28:50 +01:00
parent 136620f1e6
commit 97a676ccd7
14 changed files with 212 additions and 82 deletions

View File

@@ -134,15 +134,8 @@
{
await DialogService.LaunchAsync<CreateRoleDialog>(parameters =>
{
parameters[nameof(CreateRoleDialog.OnSubmit)] = async Task (CreateRoleDto request) =>
parameters[nameof(CreateRoleDialog.OnSubmit)] = async Task () =>
{
await HttpClient.PostAsJsonAsync(
"api/admin/roles",
request,
Constants.SerializerOptions
);
await ToastService.SuccessAsync("Role creation", $"Role {request.Name} has been successfully created");
await Grid.RefreshAsync();
};
});
@@ -153,15 +146,8 @@
await DialogService.LaunchAsync<UpdateRoleDialog>(parameters =>
{
parameters[nameof(UpdateRoleDialog.Role)] = role;
parameters[nameof(UpdateRoleDialog.OnSubmit)] = async Task (UpdateRoleDto request) =>
parameters[nameof(UpdateRoleDialog.OnSubmit)] = async Task () =>
{
await HttpClient.PatchAsJsonAsync(
$"api/admin/roles/{role.Id}",
request,
Constants.SerializerOptions
);
await ToastService.SuccessAsync("Role update", $"Role {request.Name} has been successfully updated");
await Grid.RefreshAsync();
};
});