Fixed a bug where overwriting config didnt overwrite DDNS settings
This commit is contained in:
parent
1d21d0ff1e
commit
26e091ab15
1 changed files with 4 additions and 0 deletions
|
@ -123,12 +123,16 @@ pub fn read<T>(db: &T) -> Result<Config>
|
|||
fn reset<T>(db: &T) -> Result<()>
|
||||
where T: ConnectionSource
|
||||
{
|
||||
use self::ddns_config::dsl::*;
|
||||
let connection = db.get_connection();
|
||||
let connection = connection.lock().unwrap();
|
||||
let connection = connection.deref();
|
||||
|
||||
diesel::delete(mount_points::table).execute(connection)?;
|
||||
diesel::delete(users::table).execute(connection)?;
|
||||
diesel::update(ddns_config)
|
||||
.set((host.eq(""), username.eq(""), password.eq("")))
|
||||
.execute(connection)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue