aboutsummaryrefslogtreecommitdiffstats
path: root/adenosine-cli/src
diff options
context:
space:
mode:
authorbryan newbold <bnewbold@robocracy.org>2024-05-16 13:57:32 -0700
committerbryan newbold <bnewbold@robocracy.org>2024-05-16 13:57:32 -0700
commit2d8206436bbcc3b78c7d6296dd3df1bd3af1a4fb (patch)
tree806603e7cdb26a01ff25a87fd7b40b8ea63a70d9 /adenosine-cli/src
parentec223a407b52a3d34dbeda3902b04a89c8d1d105 (diff)
downloadadenosine-2d8206436bbcc3b78c7d6296dd3df1bd3af1a4fb.tar.gz
adenosine-2d8206436bbcc3b78c7d6296dd3df1bd3af1a4fb.zip
cli: fix update commandmain
Diffstat (limited to 'adenosine-cli/src')
-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 {