ui: fix onboarding & allow for key deletion (#1928)
This commit is contained in:
@@ -123,7 +123,14 @@ pub async fn remove_config(
|
||||
|
||||
let config = Config::global();
|
||||
|
||||
match config.delete(&query.key) {
|
||||
// Check if the secret flag is true and call the appropriate method
|
||||
let result = if query.is_secret {
|
||||
config.delete_secret(&query.key)
|
||||
} else {
|
||||
config.delete(&query.key)
|
||||
};
|
||||
|
||||
match result {
|
||||
Ok(_) => Ok(Json(format!("Removed key {}", query.key))),
|
||||
Err(_) => Err(StatusCode::NOT_FOUND),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user