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