Refactor commands

This commit is contained in:
Jon Staab
2026-05-19 17:20:00 -07:00
parent dde4b981b2
commit 2d5eb0ca84
5 changed files with 222 additions and 303 deletions
+5 -7
View File
@@ -234,13 +234,11 @@ impl Infra {
});
// Only provide a secret if the relay is new. This allows us to not store the relay secrets on our side.
if is_new {
if let Some(obj) = body.as_object_mut() {
obj.insert(
"secret".to_string(),
serde_json::Value::String(Keys::generate().secret_key().to_secret_hex()),
);
}
if is_new && let Some(obj) = body.as_object_mut() {
obj.insert(
"secret".to_string(),
serde_json::Value::String(Keys::generate().secret_key().to_secret_hex()),
);
}
let method = if is_new { HttpMethod::POST } else { HttpMethod::PATCH };