aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adenosine-cli/src/bin/adenosine.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/adenosine-cli/src/bin/adenosine.rs b/adenosine-cli/src/bin/adenosine.rs
index e2f6994..5d287ee 100644
--- a/adenosine-cli/src/bin/adenosine.rs
+++ b/adenosine-cli/src/bin/adenosine.rs
@@ -241,7 +241,7 @@ enum Command {
fields: Vec<ArgField>,
/// Whether to authenticate
#[structopt(long)]
- auth: bool
+ auth: bool,
},
/// Manage user account and sessions
@@ -472,10 +472,11 @@ fn run(opt: Opt) -> Result<()> {
params.insert("collection".to_string(), collection.clone());
params.insert("rkey".to_string(), rkey.clone());
// fetch existing, extend map with fields, put the updated value
- let mut record = xrpc_client
+ let mut resp = xrpc_client
.get(&Nsid::from_str("com.atproto.repo.getRecord")?, Some(params))?
.unwrap_or(json!({}));
- update_value_from_fields(fields.clone(), &mut record);
+ let record = &mut resp["value"];
+ update_value_from_fields(fields.clone(), record);
xrpc_client.post(
&Nsid::from_str("com.atproto.repo.putRecord")?,
None,
@@ -518,9 +519,7 @@ fn run(opt: Opt) -> Result<()> {
let body = value_from_fields(fields.clone());
match method {
XrpcMethod::Get => xrpc_client.get(nsid, Some(params))?,
- XrpcMethod::Post => {
- xrpc_client.post(nsid, Some(params), Some(body))?
- }
+ XrpcMethod::Post => xrpc_client.post(nsid, Some(params), Some(body))?,
}
}
Command::Account {