2023-04-05 19:04:09 -07:00
|
|
|
use crate::api::Result;
|
|
|
|
|
use std::path::{Path, PathBuf};
|
|
|
|
|
use theseus::prelude::*;
|
|
|
|
|
|
|
|
|
|
#[tauri::command]
|
2023-05-08 12:14:08 -07:00
|
|
|
pub async fn pack_install_version_id(
|
2023-06-02 07:09:46 -07:00
|
|
|
project_id: String,
|
2023-05-08 12:14:08 -07:00
|
|
|
version_id: String,
|
2023-05-11 10:26:00 -07:00
|
|
|
pack_title: String,
|
|
|
|
|
pack_icon: Option<String>,
|
2023-05-08 12:14:08 -07:00
|
|
|
) -> Result<PathBuf> {
|
2023-06-02 07:09:46 -07:00
|
|
|
let res = pack::install_pack_from_version_id(
|
|
|
|
|
project_id, version_id, pack_title, pack_icon,
|
|
|
|
|
)
|
|
|
|
|
.await?;
|
2023-04-05 19:04:09 -07:00
|
|
|
Ok(res)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[tauri::command]
|
|
|
|
|
pub async fn pack_install_file(path: &Path) -> Result<PathBuf> {
|
|
|
|
|
let res = pack::install_pack_from_file(path.to_path_buf()).await?;
|
|
|
|
|
Ok(res)
|
|
|
|
|
}
|