expose to Tauri to ensure it works

This commit is contained in:
polv committed 2026-02-23 05:17:51 +07:00
1 parent 62cb1e5902
commit 098ee45b81
12 files changed
+108 -53

No files matched your search

+14 -1
View File
@@ -1,5 +1,5 @@
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
use cjdic2_core::{AppService, Entry};
use cjdic2_core::{AppService, Entry, db::YomitanRow};
#[tauri::command]
pub fn add_entry(name: &str, state: tauri::State<AppService>) -> Result<(), String> {
@@ -12,3 +12,16 @@ pub fn add_entry(name: &str, state: tauri::State<AppService>) -> Result<(), Stri
pub fn list_entries(state: tauri::State<AppService>) -> Result<Vec<Entry>, String> {
state.list_entries().map_err(|e| e.to_string())
}
#[tauri::command]
pub fn search_yomitan(
q_term: &str,
q_reading: &str,
limit: u32,
offset: u32,
state: tauri::State<AppService>,
) -> Result<Vec<YomitanRow>, String> {
state
.search_yomitan(q_term, q_reading, limit, offset)
.map_err(|e| e.to_string())
}