Implemented handling of server side issues using the rfc for problem detasils in the frontend
This commit is contained in:
@@ -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();
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user