diff options
author | bryan newbold <bnewbold@robocracy.org> | 2024-05-16 13:57:32 -0700 |
---|---|---|
committer | bryan newbold <bnewbold@robocracy.org> | 2024-05-16 13:57:32 -0700 |
commit | 2d8206436bbcc3b78c7d6296dd3df1bd3af1a4fb (patch) | |
tree | 806603e7cdb26a01ff25a87fd7b40b8ea63a70d9 | |
parent | ec223a407b52a3d34dbeda3902b04a89c8d1d105 (diff) | |
download | adenosine-main.tar.gz adenosine-main.zip |
cli: fix update commandmain
-rw-r--r-- | adenosine-cli/src/bin/adenosine.rs | 11 |
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 { |