分离恢复使用独立丢弃操作
新增独立的恢复状态丢弃入口 完成与 finalize 的共享状态删除逻辑
This commit is contained in:
@@ -353,7 +353,7 @@ fn inspect_separation_recovery(
|
||||
fn finalize_separation(project_path: String, asset_id: String) -> Result<(), String> {
|
||||
let root = Path::new(project_path.trim());
|
||||
enforce_project_permission_policy(root, "asset.register")?;
|
||||
ui_editor::commands::separation::finalize_separation(root, &asset_id)
|
||||
ui_editor::commands::separation::discard_separation_recovery(root, &asset_id)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
||||
@@ -187,6 +187,14 @@ pub fn inspect_separation_recovery(
|
||||
}
|
||||
|
||||
pub fn finalize_separation(root: &Path, asset_id: &str) -> Result<(), String> {
|
||||
remove_separation_state(root, asset_id)
|
||||
}
|
||||
|
||||
pub fn discard_separation_recovery(root: &Path, asset_id: &str) -> Result<(), String> {
|
||||
remove_separation_state(root, asset_id)
|
||||
}
|
||||
|
||||
fn remove_separation_state(root: &Path, asset_id: &str) -> Result<(), String> {
|
||||
let state_path = separation_state_path(root, asset_id)?;
|
||||
match fs::remove_file(&state_path) {
|
||||
Ok(()) => Ok(()),
|
||||
|
||||
Reference in New Issue
Block a user