mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 05:13:18 -07:00
Fixed a bug with the notification preferences !wip
This commit is contained in:
parent
91b6dfe2b7
commit
550028b9eb
1 changed files with 13 additions and 9 deletions
|
@ -579,11 +579,11 @@ namespace Ombi.Controllers
|
||||||
{
|
{
|
||||||
Errors = messages
|
Errors = messages
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// Add the quality profiles
|
// Add the quality profiles
|
||||||
if (ui.UserQualityProfiles != null)
|
if (ui.UserQualityProfiles != null)
|
||||||
{
|
{
|
||||||
var currentQualityProfiles = await
|
var currentQualityProfiles = await
|
||||||
_userQualityProfiles.GetAll().FirstOrDefaultAsync(x => x.UserId == user.Id);
|
_userQualityProfiles.GetAll().FirstOrDefaultAsync(x => x.UserId == user.Id);
|
||||||
var add = false;
|
var add = false;
|
||||||
if (currentQualityProfiles == null)
|
if (currentQualityProfiles == null)
|
||||||
|
@ -955,19 +955,23 @@ namespace Ombi.Controllers
|
||||||
// Update it
|
// Update it
|
||||||
existingPreference.Value = pref.Value;
|
existingPreference.Value = pref.Value;
|
||||||
existingPreference.Enabled = pref.Enabled;
|
existingPreference.Enabled = pref.Enabled;
|
||||||
|
await _userNotificationPreferences.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
await _userNotificationPreferences.Add(new UserNotificationPreferences
|
else
|
||||||
{
|
{
|
||||||
Agent = pref.Agent,
|
await _userNotificationPreferences.Add(new UserNotificationPreferences
|
||||||
Enabled = pref.Enabled,
|
{
|
||||||
UserId = pref.UserId,
|
Agent = pref.Agent,
|
||||||
Value = pref.Value
|
Enabled = pref.Enabled,
|
||||||
});
|
UserId = pref.UserId,
|
||||||
|
Value = pref.Value
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return Json(true);
|
return Json(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<List<IdentityResult>> AddRoles(IEnumerable<ClaimCheckboxes> roles, OmbiUser ombiUser)
|
private async Task<List<IdentityResult>> AddRoles(IEnumerable<ClaimCheckboxes> roles, OmbiUser ombiUser)
|
||||||
{
|
{
|
||||||
var roleResult = new List<IdentityResult>();
|
var roleResult = new List<IdentityResult>();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue