mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-09 21:49:46 -05:00
simplify UI preferences change logic
I copied the example of the password field by introducing a setter. But I forgot: it was only that way because the password field has the complexity of hashing/salting. For fields where setting is idempotent, it can be directly exposed.
This commit is contained in:
@@ -1042,7 +1042,7 @@ impl Service {
|
||||
if let Some(update) = r.update {
|
||||
let mut change = user.change();
|
||||
if let Some(preferences) = update.preferences {
|
||||
change.set_preferences(preferences);
|
||||
change.preferences = preferences;
|
||||
}
|
||||
db.apply_user_change(change).map_err(internal_server_err)?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user