fixed update method
This commit is contained in:
@ -39,7 +39,7 @@ namespace UserService.Pages
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
OrganizationUnits = (await OuRepository.GetAllAsync().ConfigureAwait(false))
|
||||
.Where(x => x.Parent is null)
|
||||
.Where(x => x.ParentId is null)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ namespace UserService.Pages
|
||||
if (arg is null) throw new ArgumentNullException(nameof(arg));
|
||||
var user = arg.Item;
|
||||
await UsersRepository.AddAsync(user).ConfigureAwait(false);
|
||||
user.Parent = OrganizationUnits?.FirstOrDefault(x => x.Id == user.ParentId);
|
||||
//user.Parent = OrganizationUnits?.FirstOrDefault(x => x.Id == user.ParentId);
|
||||
}
|
||||
|
||||
protected override async Task RowDeletingCallback(CancellableRowChange<User> arg)
|
||||
@ -71,7 +71,7 @@ namespace UserService.Pages
|
||||
if (arg == null) throw new ArgumentNullException(nameof(arg));
|
||||
var user = arg.Item;
|
||||
user.MapFields(arg.Values);
|
||||
user.Parent = OrganizationUnits?.FirstOrDefault(x => x.Id == (Guid?)arg.Values[nameof(Node.ParentId)]);
|
||||
user.ParentId = (int?)arg.Values[nameof(Node.ParentId)];
|
||||
var result = await UsersRepository.UpdateAsync(user).ConfigureAwait(false);
|
||||
arg.Cancel = !result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user