Mountain/IPC/WindAirCommands/
ApplyUpdate.rs1#![allow(non_snake_case)]
2
3use crate::{
7 IPC::WindAirCommands::{GetAirAddress, GetOrCreateAirClient},
8 dev_log,
9};
10
11#[tauri::command]
12pub async fn ApplyUpdate(update_id:String, update_path:String) -> Result<bool, String> {
13 dev_log!(
14 "grpc",
15 "[WindAirCommands] ApplyUpdate called: id={}, path={}",
16 update_id,
17 update_path
18 );
19
20 let air_address = GetAirAddress::Fn()?;
21
22 let client = GetOrCreateAirClient::Fn(air_address).await?;
23
24 let request_id = uuid::Uuid::new_v4().to_string();
25
26 client
27 .apply_update(request_id, update_id, update_path)
28 .await
29 .map_err(|e| format!("Update application failed: {:?}", e))?;
30
31 dev_log!("grpc", "[WindAirCommands] Update applied successfully");
32
33 Ok(true)
34}