fix login
This commit is contained in:
@@ -31,16 +31,14 @@ pub async fn put_record(file: &str, collection: &str, rkey: Option<&str>) -> Res
|
||||
record,
|
||||
};
|
||||
|
||||
println!("Posting to {} with rkey: {}", collection, rkey);
|
||||
println!("{}", serde_json::to_string_pretty(&req)?);
|
||||
|
||||
let result: PutRecordResponse = client
|
||||
.call(&com_atproto_repo::PUT_RECORD, &req, &session.access_jwt)
|
||||
.await?;
|
||||
|
||||
println!("Success!");
|
||||
println!(" URI: {}", result.uri);
|
||||
println!(" CID: {}", result.cid);
|
||||
println!("{}", serde_json::to_string_pretty(&serde_json::json!({
|
||||
"uri": result.uri,
|
||||
"cid": result.cid,
|
||||
}))?);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -67,16 +65,14 @@ pub async fn put_lexicon(file: &str) -> Result<()> {
|
||||
record: lexicon,
|
||||
};
|
||||
|
||||
println!("Putting lexicon: {}", lexicon_id);
|
||||
println!("{}", serde_json::to_string_pretty(&req)?);
|
||||
|
||||
let result: PutRecordResponse = client
|
||||
.call(&com_atproto_repo::PUT_RECORD, &req, &session.access_jwt)
|
||||
.await?;
|
||||
|
||||
println!("Success!");
|
||||
println!(" URI: {}", result.uri);
|
||||
println!(" CID: {}", result.cid);
|
||||
println!("{}", serde_json::to_string_pretty(&serde_json::json!({
|
||||
"uri": result.uri,
|
||||
"cid": result.cid,
|
||||
}))?);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -100,13 +96,7 @@ pub async fn get_records(collection: &str, limit: u32) -> Result<()> {
|
||||
)
|
||||
.await?;
|
||||
|
||||
println!("Found {} records in {}", result.records.len(), collection);
|
||||
for record in &result.records {
|
||||
println!("---");
|
||||
println!("URI: {}", record.uri);
|
||||
println!("CID: {}", record.cid);
|
||||
println!("{}", serde_json::to_string_pretty(&record.value)?);
|
||||
}
|
||||
println!("{}", serde_json::to_string_pretty(&result)?);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -127,13 +117,15 @@ pub async fn delete_record(collection: &str, rkey: &str, is_bot: bool) -> Result
|
||||
rkey: rkey.to_string(),
|
||||
};
|
||||
|
||||
println!("Deleting {} from {}", rkey, collection);
|
||||
|
||||
client
|
||||
.call_no_response(&com_atproto_repo::DELETE_RECORD, &req, &session.access_jwt)
|
||||
.await?;
|
||||
|
||||
println!("Deleted successfully");
|
||||
println!("{}", serde_json::to_string_pretty(&serde_json::json!({
|
||||
"deleted": true,
|
||||
"collection": collection,
|
||||
"rkey": rkey,
|
||||
}))?);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user