Fixed the issue where you couldn't remove a legacy user from the notifications

This commit is contained in:
tidusjar 2021-05-07 19:36:07 +01:00
commit 50af2b8482

View file

@ -92,7 +92,7 @@ namespace Ombi.Controllers.V1
[Admin] [Admin]
public async Task<bool> RemoveUser([FromBody] RemoveUserModel userId) public async Task<bool> RemoveUser([FromBody] RemoveUserModel userId)
{ {
var user = await _userManager.Users.Include(x => x.NotificationUserIds).FirstOrDefaultAsync(x => x.Id.Equals(userId.UserId, StringComparison.InvariantCultureIgnoreCase)); var user = await _userManager.Users.Include(x => x.NotificationUserIds).FirstOrDefaultAsync(x => x.Id == userId.UserId);
try try
{ {
await _notification.DeleteRange(user.NotificationUserIds); await _notification.DeleteRange(user.NotificationUserIds);