Send inventory to rust

This commit is contained in:
Bianca Fürstenau 2025-02-16 16:01:14 +01:00
parent 43bcfac938
commit e4dc811434
4 changed files with 16 additions and 6 deletions

View file

@ -55,7 +55,7 @@ impl easy::Handler for Collector {
}
}
pub fn data_client(file: &str) -> Result<Easy2<Collector>, ()> {
fn data_client(file: &str) -> Result<Easy2<Collector>, ()> {
let mut client = Easy2::new(Collector(Vec::new(), Vec::new(), 0));
let url = format!(
"https://cloud.seebruecke.org/public.php/webdav/data/{}",

View file

@ -4,6 +4,7 @@ use rusqlite::{types::ToSqlOutput, Connection, ToSql};
use tauri::{Manager, State};
use tauri_plugin_fs::FsExt;
use tokio::sync::Mutex;
use std::collections::HashMap;
mod app_state;
mod data_door;
@ -49,6 +50,15 @@ impl ToSql for Store {
}
}
#[tauri::command]
async fn inventory(
data: HashMap<String, String>,
state: State<'_, Mutex<AppState>>,
) -> Result<(), ()> {
println!("{:?}", data);
Ok(())
}
#[tauri::command]
async fn swap(
store: &str,
@ -107,6 +117,7 @@ pub fn run() {
.invoke_handler(tauri::generate_handler![
swap,
count,
inventory,
data_door::pull_data,
data_door::push_data,
])