Add note duplication (#24)

This commit is contained in:
Yuri Karamian
2026-08-03 13:23:18 +02:00
parent 1a880a4f96
commit e6e1ed1ed6
6 changed files with 158 additions and 7 deletions
+14
View File
@@ -596,6 +596,20 @@ pub fn save_note(
Ok(())
}
#[tauri::command]
pub fn duplicate_note(
state: State<'_, AppState>,
path: String,
) -> Result<crate::types::NoteEntry, String> {
let config = state.config.lock().map_err(|e| e.to_string())?;
let vault = config.active_vault.as_ref().ok_or("No active vault")?.clone();
drop(config);
let entry = operations::duplicate_note(&path, &vault)?;
index_note_bg(&state, &entry.path);
Ok(entry)
}
#[tauri::command]
pub fn create_note(
state: State<'_, AppState>,