Refactor Users page: update Autocomplete selection mode and fix user service methods to use OldItem for adding and updating users
This commit is contained in:
@@ -134,7 +134,7 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
/// <param name="arg">The arg</param>
|
||||
private async Task RowInserted(SavedRowItem<User, Dictionary<string, object>> arg)
|
||||
{
|
||||
var addUserR = await UserService.AddUserAsync(arg.Item);
|
||||
var addUserR = await UserService.AddUserAsync(arg.OldItem);
|
||||
if (!addUserR.Success)
|
||||
await Notification.Error($"Fehler beim Anlegen: {addUserR.ErrorMessage}")!;
|
||||
else
|
||||
@@ -151,9 +151,9 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
/// <param name="arg">The arg</param>
|
||||
private async Task RowUpdated(SavedRowItem<User, Dictionary<string, object>> arg)
|
||||
{
|
||||
if (arg.Item?.Id == null || arg.Item.Id.Equals(Guid.Empty) || arg.Values?.Any() != true) return;
|
||||
if (arg.OldItem?.Id == null || arg.OldItem.Id.Equals(Guid.Empty) || arg.Values?.Any() != true) return;
|
||||
|
||||
var updateR = await UserService.Update(arg.Item);
|
||||
var updateR = await UserService.Update(arg.OldItem);
|
||||
if (!updateR.Success)
|
||||
await Notification.Error($"Fehler beim Speichern: {updateR.ErrorMessage}")!;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user