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:
a.beging@eas-solutions.de
2026-04-23 15:44:27 +02:00
parent 94a2dbf801
commit b1ed916da4
3 changed files with 7 additions and 7 deletions

View File

@@ -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}")!;
}