Fixed a bug with the notification preferences !wip

This commit is contained in:
Jamie 2018-09-20 21:44:30 +01:00
commit 550028b9eb

View file

@ -955,14 +955,18 @@ 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);