diff --git a/src/rocket_api.rs b/src/rocket_api.rs index 7e74ebd..1f1eb10 100644 --- a/src/rocket_api.rs +++ b/src/rocket_api.rs @@ -12,7 +12,7 @@ const CURRENT_MAJOR_VERSION: i32 = 2; const CURRENT_MINOR_VERSION: i32 = 2; pub fn get_routes() -> Vec { - routes![version, initial_setup, get_settings,] + routes![version, initial_setup, get_settings, put_settings] } struct Auth { @@ -88,3 +88,9 @@ fn get_settings(db: State, _admin_rights: AdminRights) -> Result(&db)?; Ok(Json(config)) } + +#[put("/settings", data = "")] +fn put_settings(db: State, _admin_rights: AdminRights, config: Json) -> Result<(), errors::Error> { + config::amend::(&db, &config)?; + Ok(()) +}