Progress towards inventory
This commit is contained in:
parent
48ec66d64b
commit
aecde207f9
3 changed files with 95 additions and 15 deletions
|
@ -83,7 +83,7 @@ fn put_client(file: &str, payload: &[u8]) -> Result<Easy2<Collector>, ()> {
|
|||
|
||||
#[tauri::command]
|
||||
pub async fn pull_data(
|
||||
state: State<'_, Mutex<AppState>>,
|
||||
_state: State<'_, Mutex<AppState>>,
|
||||
) -> Result<String, ()> {
|
||||
let mut client = data_client("")?;
|
||||
client.custom_request("PROPFIND").map_err(|_| ())?;
|
||||
|
@ -95,8 +95,8 @@ pub async fn pull_data(
|
|||
async fn push_key(id: &u64, key: &SigningKey) -> Result<(), ()> {
|
||||
let file = format!("{:016X}.key", id);
|
||||
let v_key = key.verifying_key();
|
||||
let mut client = put_client(&file, v_key.as_ref())?;
|
||||
let perf = client.perform()
|
||||
let client = put_client(&file, v_key.as_ref())?;
|
||||
let _perf = client.perform()
|
||||
.map_err(|e| println!("{:?}", e))?;
|
||||
Ok(())
|
||||
}
|
||||
|
@ -109,8 +109,8 @@ fn push_db(id: &u64, db: &Connection, app: tauri::AppHandle) -> Result<(), ()> {
|
|||
.map_err(|e| println!("{:?}", e))?;
|
||||
let buf = std::fs::read(&path)
|
||||
.map_err(|e| println!("{:?}", e))?;
|
||||
let mut client = put_client(&filename, buf.as_ref())?;
|
||||
let perf = client.perform()
|
||||
let client = put_client(&filename, buf.as_ref())?;
|
||||
let _perf = client.perform()
|
||||
.map_err(|e| println!("{:?}", e))?;
|
||||
Ok(())
|
||||
}
|
||||
|
@ -122,6 +122,6 @@ pub async fn push_data(
|
|||
) -> Result<(), ()> {
|
||||
let state = state.lock().await;
|
||||
push_key(&state.id, &state.key).await?;
|
||||
push_db(&state.id, &state.db, app);
|
||||
push_db(&state.id, &state.db, app)?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue