Implemented handling of server side issues using the rfc for problem detasils in the frontend
This commit is contained in:
@@ -124,19 +124,8 @@
|
||||
{
|
||||
await DialogService.LaunchAsync<CreateUserDialog>(parameters =>
|
||||
{
|
||||
parameters[nameof(CreateUserDialog.OnSubmit)] = async (CreateUserDto dto) =>
|
||||
parameters[nameof(CreateUserDialog.OnCompleted)] = async () =>
|
||||
{
|
||||
await HttpClient.PostAsJsonAsync(
|
||||
"/api/admin/users",
|
||||
dto,
|
||||
Constants.SerializerOptions
|
||||
);
|
||||
|
||||
await ToastService.SuccessAsync(
|
||||
"User creation",
|
||||
$"Successfully created user {dto.Username}"
|
||||
);
|
||||
|
||||
await Grid.RefreshAsync();
|
||||
};
|
||||
});
|
||||
@@ -147,18 +136,8 @@
|
||||
await DialogService.LaunchAsync<UpdateUserDialog>(parameters =>
|
||||
{
|
||||
parameters[nameof(UpdateUserDialog.User)] = user;
|
||||
parameters[nameof(CreateUserDialog.OnSubmit)] = async (UpdateUserDto dto) =>
|
||||
parameters[nameof(UpdateUserDialog.OnCompleted)] = async () =>
|
||||
{
|
||||
await HttpClient.PatchAsJsonAsync(
|
||||
$"/api/admin/users/{user.Id}",
|
||||
dto
|
||||
);
|
||||
|
||||
await ToastService.SuccessAsync(
|
||||
"User update",
|
||||
$"Successfully updated user {dto.Username}"
|
||||
);
|
||||
|
||||
await Grid.RefreshAsync();
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user