|
|
@ -83,12 +83,16 @@ namespace Ombi.Controllers.V1
|
|
|
|
return vm;
|
|
|
|
return vm;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class RemoveUserModel
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
public string UserId { get; set; }
|
|
|
|
|
|
|
|
}
|
|
|
|
[HttpPost]
|
|
|
|
[HttpPost]
|
|
|
|
[ApiExplorerSettings(IgnoreApi = true)]
|
|
|
|
[ApiExplorerSettings(IgnoreApi = true)]
|
|
|
|
[Admin]
|
|
|
|
[Admin]
|
|
|
|
public async Task<bool> RemoveUser([FromBody] string userId)
|
|
|
|
public async Task<bool> RemoveUser([FromBody] RemoveUserModel userId)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var user = await _userManager.Users.Include(x => x.NotificationUserIds).FirstOrDefaultAsync(x => x.Id.Equals(userId, StringComparison.InvariantCultureIgnoreCase));
|
|
|
|
var user = await _userManager.Users.Include(x => x.NotificationUserIds).FirstOrDefaultAsync(x => x.Id.Equals(userId.UserId, StringComparison.InvariantCultureIgnoreCase));
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
await _notification.DeleteRange(user.NotificationUserIds);
|
|
|
|
await _notification.DeleteRange(user.NotificationUserIds);
|
|
|
|