fix(error): migrate remaining Rust commands to AppError (btmsg, bttask, knowledge, plugins, search)
This commit is contained in:
parent
4fccc3f3e0
commit
eb04e7e5b5
5 changed files with 106 additions and 91 deletions
|
|
@ -1,132 +1,133 @@
|
|||
use crate::btmsg;
|
||||
use crate::error::AppError;
|
||||
use crate::groups;
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_get_agents(group_id: String) -> Result<Vec<btmsg::BtmsgAgent>, String> {
|
||||
btmsg::get_agents(&group_id)
|
||||
pub fn btmsg_get_agents(group_id: String) -> Result<Vec<btmsg::BtmsgAgent>, AppError> {
|
||||
btmsg::get_agents(&group_id).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_unread_count(agent_id: String) -> Result<i32, String> {
|
||||
btmsg::unread_count(&agent_id)
|
||||
pub fn btmsg_unread_count(agent_id: String) -> Result<i32, AppError> {
|
||||
btmsg::unread_count(&agent_id).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_unread_messages(agent_id: String) -> Result<Vec<btmsg::BtmsgMessage>, String> {
|
||||
btmsg::unread_messages(&agent_id)
|
||||
pub fn btmsg_unread_messages(agent_id: String) -> Result<Vec<btmsg::BtmsgMessage>, AppError> {
|
||||
btmsg::unread_messages(&agent_id).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_history(agent_id: String, other_id: String, limit: i32) -> Result<Vec<btmsg::BtmsgMessage>, String> {
|
||||
btmsg::history(&agent_id, &other_id, limit)
|
||||
pub fn btmsg_history(agent_id: String, other_id: String, limit: i32) -> Result<Vec<btmsg::BtmsgMessage>, AppError> {
|
||||
btmsg::history(&agent_id, &other_id, limit).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_send(from_agent: String, to_agent: String, content: String) -> Result<String, String> {
|
||||
btmsg::send_message(&from_agent, &to_agent, &content)
|
||||
pub fn btmsg_send(from_agent: String, to_agent: String, content: String) -> Result<String, AppError> {
|
||||
btmsg::send_message(&from_agent, &to_agent, &content).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_set_status(agent_id: String, status: String) -> Result<(), String> {
|
||||
btmsg::set_status(&agent_id, &status)
|
||||
pub fn btmsg_set_status(agent_id: String, status: String) -> Result<(), AppError> {
|
||||
btmsg::set_status(&agent_id, &status).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_ensure_admin(group_id: String) -> Result<(), String> {
|
||||
btmsg::ensure_admin(&group_id)
|
||||
pub fn btmsg_ensure_admin(group_id: String) -> Result<(), AppError> {
|
||||
btmsg::ensure_admin(&group_id).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_all_feed(group_id: String, limit: i32) -> Result<Vec<btmsg::BtmsgFeedMessage>, String> {
|
||||
btmsg::all_feed(&group_id, limit)
|
||||
pub fn btmsg_all_feed(group_id: String, limit: i32) -> Result<Vec<btmsg::BtmsgFeedMessage>, AppError> {
|
||||
btmsg::all_feed(&group_id, limit).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_mark_read(reader_id: String, sender_id: String) -> Result<(), String> {
|
||||
btmsg::mark_read_conversation(&reader_id, &sender_id)
|
||||
pub fn btmsg_mark_read(reader_id: String, sender_id: String) -> Result<(), AppError> {
|
||||
btmsg::mark_read_conversation(&reader_id, &sender_id).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_get_channels(group_id: String) -> Result<Vec<btmsg::BtmsgChannel>, String> {
|
||||
btmsg::get_channels(&group_id)
|
||||
pub fn btmsg_get_channels(group_id: String) -> Result<Vec<btmsg::BtmsgChannel>, AppError> {
|
||||
btmsg::get_channels(&group_id).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_channel_messages(channel_id: String, limit: i32) -> Result<Vec<btmsg::BtmsgChannelMessage>, String> {
|
||||
btmsg::get_channel_messages(&channel_id, limit)
|
||||
pub fn btmsg_channel_messages(channel_id: String, limit: i32) -> Result<Vec<btmsg::BtmsgChannelMessage>, AppError> {
|
||||
btmsg::get_channel_messages(&channel_id, limit).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_channel_send(channel_id: String, from_agent: String, content: String) -> Result<String, String> {
|
||||
btmsg::send_channel_message(&channel_id, &from_agent, &content)
|
||||
pub fn btmsg_channel_send(channel_id: String, from_agent: String, content: String) -> Result<String, AppError> {
|
||||
btmsg::send_channel_message(&channel_id, &from_agent, &content).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_create_channel(name: String, group_id: String, created_by: String) -> Result<String, String> {
|
||||
btmsg::create_channel(&name, &group_id, &created_by)
|
||||
pub fn btmsg_create_channel(name: String, group_id: String, created_by: String) -> Result<String, AppError> {
|
||||
btmsg::create_channel(&name, &group_id, &created_by).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_add_channel_member(channel_id: String, agent_id: String) -> Result<(), String> {
|
||||
btmsg::add_channel_member(&channel_id, &agent_id)
|
||||
pub fn btmsg_add_channel_member(channel_id: String, agent_id: String) -> Result<(), AppError> {
|
||||
btmsg::add_channel_member(&channel_id, &agent_id).map_err(AppError::database)
|
||||
}
|
||||
|
||||
/// Register all agents from a GroupsFile into the btmsg database.
|
||||
/// Creates/updates agent records, sets up contact permissions, ensures review channels.
|
||||
#[tauri::command]
|
||||
pub fn btmsg_register_agents(config: groups::GroupsFile) -> Result<(), String> {
|
||||
btmsg::register_agents_from_groups(&config)
|
||||
pub fn btmsg_register_agents(config: groups::GroupsFile) -> Result<(), AppError> {
|
||||
btmsg::register_agents_from_groups(&config).map_err(AppError::database)
|
||||
}
|
||||
|
||||
// ---- Per-message acknowledgment (seen_messages) ----
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_unseen_messages(agent_id: String, session_id: String) -> Result<Vec<btmsg::BtmsgMessage>, String> {
|
||||
btmsg::unseen_messages(&agent_id, &session_id)
|
||||
pub fn btmsg_unseen_messages(agent_id: String, session_id: String) -> Result<Vec<btmsg::BtmsgMessage>, AppError> {
|
||||
btmsg::unseen_messages(&agent_id, &session_id).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_mark_seen(session_id: String, message_ids: Vec<String>) -> Result<(), String> {
|
||||
btmsg::mark_messages_seen(&session_id, &message_ids)
|
||||
pub fn btmsg_mark_seen(session_id: String, message_ids: Vec<String>) -> Result<(), AppError> {
|
||||
btmsg::mark_messages_seen(&session_id, &message_ids).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_prune_seen() -> Result<u64, String> {
|
||||
btmsg::prune_seen_messages(7 * 24 * 3600, 200_000)
|
||||
pub fn btmsg_prune_seen() -> Result<u64, AppError> {
|
||||
btmsg::prune_seen_messages(7 * 24 * 3600, 200_000).map_err(AppError::database)
|
||||
}
|
||||
|
||||
// ---- Heartbeat monitoring ----
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_record_heartbeat(agent_id: String) -> Result<(), String> {
|
||||
btmsg::record_heartbeat(&agent_id)
|
||||
pub fn btmsg_record_heartbeat(agent_id: String) -> Result<(), AppError> {
|
||||
btmsg::record_heartbeat(&agent_id).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_get_stale_agents(group_id: String, threshold_secs: i64) -> Result<Vec<String>, String> {
|
||||
btmsg::get_stale_agents(&group_id, threshold_secs)
|
||||
pub fn btmsg_get_stale_agents(group_id: String, threshold_secs: i64) -> Result<Vec<String>, AppError> {
|
||||
btmsg::get_stale_agents(&group_id, threshold_secs).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_get_agent_heartbeats(group_id: String) -> Result<Vec<btmsg::AgentHeartbeat>, String> {
|
||||
btmsg::get_agent_heartbeats(&group_id)
|
||||
pub fn btmsg_get_agent_heartbeats(group_id: String) -> Result<Vec<btmsg::AgentHeartbeat>, AppError> {
|
||||
btmsg::get_agent_heartbeats(&group_id).map_err(AppError::database)
|
||||
}
|
||||
|
||||
// ---- Dead letter queue ----
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_get_dead_letters(group_id: String, limit: i32) -> Result<Vec<btmsg::DeadLetter>, String> {
|
||||
btmsg::get_dead_letters(&group_id, limit)
|
||||
pub fn btmsg_get_dead_letters(group_id: String, limit: i32) -> Result<Vec<btmsg::DeadLetter>, AppError> {
|
||||
btmsg::get_dead_letters(&group_id, limit).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_clear_dead_letters(group_id: String) -> Result<(), String> {
|
||||
btmsg::clear_dead_letters(&group_id)
|
||||
pub fn btmsg_clear_dead_letters(group_id: String) -> Result<(), AppError> {
|
||||
btmsg::clear_dead_letters(&group_id).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn btmsg_clear_all_comms(group_id: String) -> Result<(), String> {
|
||||
btmsg::clear_all_communications(&group_id)
|
||||
pub fn btmsg_clear_all_comms(group_id: String) -> Result<(), AppError> {
|
||||
btmsg::clear_all_communications(&group_id).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
|
@ -135,23 +136,24 @@ pub fn btmsg_queue_dead_letter(
|
|||
to_agent: String,
|
||||
content: String,
|
||||
error: String,
|
||||
) -> Result<(), String> {
|
||||
) -> Result<(), AppError> {
|
||||
btmsg::queue_dead_letter(&from_agent, &to_agent, &content, &error)
|
||||
.map_err(AppError::database)
|
||||
}
|
||||
|
||||
// ---- Audit log ----
|
||||
|
||||
#[tauri::command]
|
||||
pub fn audit_log_event(agent_id: String, event_type: String, detail: String) -> Result<(), String> {
|
||||
btmsg::log_audit_event(&agent_id, &event_type, &detail)
|
||||
pub fn audit_log_event(agent_id: String, event_type: String, detail: String) -> Result<(), AppError> {
|
||||
btmsg::log_audit_event(&agent_id, &event_type, &detail).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn audit_log_list(group_id: String, limit: i32, offset: i32) -> Result<Vec<btmsg::AuditEntry>, String> {
|
||||
btmsg::get_audit_log(&group_id, limit, offset)
|
||||
pub fn audit_log_list(group_id: String, limit: i32, offset: i32) -> Result<Vec<btmsg::AuditEntry>, AppError> {
|
||||
btmsg::get_audit_log(&group_id, limit, offset).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn audit_log_for_agent(agent_id: String, limit: i32) -> Result<Vec<btmsg::AuditEntry>, String> {
|
||||
btmsg::get_audit_log_for_agent(&agent_id, limit)
|
||||
pub fn audit_log_for_agent(agent_id: String, limit: i32) -> Result<Vec<btmsg::AuditEntry>, AppError> {
|
||||
btmsg::get_audit_log_for_agent(&agent_id, limit).map_err(AppError::database)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,24 @@
|
|||
use crate::bttask;
|
||||
use crate::error::AppError;
|
||||
|
||||
#[tauri::command]
|
||||
pub fn bttask_list(group_id: String) -> Result<Vec<bttask::Task>, String> {
|
||||
bttask::list_tasks(&group_id)
|
||||
pub fn bttask_list(group_id: String) -> Result<Vec<bttask::Task>, AppError> {
|
||||
bttask::list_tasks(&group_id).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn bttask_comments(task_id: String) -> Result<Vec<bttask::TaskComment>, String> {
|
||||
bttask::task_comments(&task_id)
|
||||
pub fn bttask_comments(task_id: String) -> Result<Vec<bttask::TaskComment>, AppError> {
|
||||
bttask::task_comments(&task_id).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn bttask_update_status(task_id: String, status: String, version: i64) -> Result<i64, String> {
|
||||
bttask::update_task_status(&task_id, &status, version)
|
||||
pub fn bttask_update_status(task_id: String, status: String, version: i64) -> Result<i64, AppError> {
|
||||
bttask::update_task_status(&task_id, &status, version).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn bttask_add_comment(task_id: String, agent_id: String, content: String) -> Result<String, String> {
|
||||
bttask::add_comment(&task_id, &agent_id, &content)
|
||||
pub fn bttask_add_comment(task_id: String, agent_id: String, content: String) -> Result<String, AppError> {
|
||||
bttask::add_comment(&task_id, &agent_id, &content).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
|
@ -28,16 +29,17 @@ pub fn bttask_create(
|
|||
group_id: String,
|
||||
created_by: String,
|
||||
assigned_to: Option<String>,
|
||||
) -> Result<String, String> {
|
||||
) -> Result<String, AppError> {
|
||||
bttask::create_task(&title, &description, &priority, &group_id, &created_by, assigned_to.as_deref())
|
||||
.map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn bttask_delete(task_id: String) -> Result<(), String> {
|
||||
bttask::delete_task(&task_id)
|
||||
pub fn bttask_delete(task_id: String) -> Result<(), AppError> {
|
||||
bttask::delete_task(&task_id).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn bttask_review_queue_count(group_id: String) -> Result<i64, String> {
|
||||
bttask::review_queue_count(&group_id)
|
||||
pub fn bttask_review_queue_count(group_id: String) -> Result<i64, AppError> {
|
||||
bttask::review_queue_count(&group_id).map_err(AppError::database)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,37 +1,39 @@
|
|||
use tauri::State;
|
||||
use crate::AppState;
|
||||
use crate::error::AppError;
|
||||
use crate::{ctx, memora};
|
||||
|
||||
// --- ctx commands ---
|
||||
|
||||
#[tauri::command]
|
||||
pub fn ctx_init_db(state: State<'_, AppState>) -> Result<(), String> {
|
||||
state.ctx_db.init_db()
|
||||
pub fn ctx_init_db(state: State<'_, AppState>) -> Result<(), AppError> {
|
||||
state.ctx_db.init_db().map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn ctx_register_project(state: State<'_, AppState>, name: String, description: String, work_dir: Option<String>) -> Result<(), String> {
|
||||
pub fn ctx_register_project(state: State<'_, AppState>, name: String, description: String, work_dir: Option<String>) -> Result<(), AppError> {
|
||||
state.ctx_db.register_project(&name, &description, work_dir.as_deref())
|
||||
.map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn ctx_get_context(state: State<'_, AppState>, project: String) -> Result<Vec<ctx::CtxEntry>, String> {
|
||||
state.ctx_db.get_context(&project)
|
||||
pub fn ctx_get_context(state: State<'_, AppState>, project: String) -> Result<Vec<ctx::CtxEntry>, AppError> {
|
||||
state.ctx_db.get_context(&project).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn ctx_get_shared(state: State<'_, AppState>) -> Result<Vec<ctx::CtxEntry>, String> {
|
||||
state.ctx_db.get_shared()
|
||||
pub fn ctx_get_shared(state: State<'_, AppState>) -> Result<Vec<ctx::CtxEntry>, AppError> {
|
||||
state.ctx_db.get_shared().map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn ctx_get_summaries(state: State<'_, AppState>, project: String, limit: i64) -> Result<Vec<ctx::CtxSummary>, String> {
|
||||
state.ctx_db.get_summaries(&project, limit)
|
||||
pub fn ctx_get_summaries(state: State<'_, AppState>, project: String, limit: i64) -> Result<Vec<ctx::CtxSummary>, AppError> {
|
||||
state.ctx_db.get_summaries(&project, limit).map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn ctx_search(state: State<'_, AppState>, query: String) -> Result<Vec<ctx::CtxEntry>, String> {
|
||||
state.ctx_db.search(&query)
|
||||
pub fn ctx_search(state: State<'_, AppState>, query: String) -> Result<Vec<ctx::CtxEntry>, AppError> {
|
||||
state.ctx_db.search(&query).map_err(AppError::database)
|
||||
}
|
||||
|
||||
// --- Memora commands (read-only) ---
|
||||
|
|
@ -47,8 +49,9 @@ pub fn memora_list(
|
|||
tags: Option<Vec<String>>,
|
||||
limit: Option<i64>,
|
||||
offset: Option<i64>,
|
||||
) -> Result<memora::MemoraSearchResult, String> {
|
||||
) -> Result<memora::MemoraSearchResult, AppError> {
|
||||
state.memora_db.list(tags, limit.unwrap_or(50), offset.unwrap_or(0))
|
||||
.map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
|
@ -57,11 +60,12 @@ pub fn memora_search(
|
|||
query: String,
|
||||
tags: Option<Vec<String>>,
|
||||
limit: Option<i64>,
|
||||
) -> Result<memora::MemoraSearchResult, String> {
|
||||
) -> Result<memora::MemoraSearchResult, AppError> {
|
||||
state.memora_db.search(&query, tags, limit.unwrap_or(50))
|
||||
.map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn memora_get(state: State<'_, AppState>, id: i64) -> Result<Option<memora::MemoraNode>, String> {
|
||||
state.memora_db.get(id)
|
||||
pub fn memora_get(state: State<'_, AppState>, id: i64) -> Result<Option<memora::MemoraNode>, AppError> {
|
||||
state.memora_db.get(id).map_err(AppError::database)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// Plugin discovery and file access commands
|
||||
|
||||
use crate::AppState;
|
||||
use crate::error::AppError;
|
||||
use crate::plugins;
|
||||
|
||||
#[tauri::command]
|
||||
|
|
@ -14,7 +15,8 @@ pub fn plugin_read_file(
|
|||
state: tauri::State<'_, AppState>,
|
||||
plugin_id: String,
|
||||
filename: String,
|
||||
) -> Result<String, String> {
|
||||
) -> Result<String, AppError> {
|
||||
let plugins_dir = state.app_config.plugins_dir();
|
||||
plugins::read_plugin_file(&plugins_dir, &plugin_id, &filename)
|
||||
.map_err(AppError::config)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
use crate::AppState;
|
||||
use crate::error::AppError;
|
||||
use crate::search::SearchResult;
|
||||
use tauri::State;
|
||||
|
||||
#[tauri::command]
|
||||
pub fn search_init(state: State<'_, AppState>) -> Result<(), String> {
|
||||
pub fn search_init(state: State<'_, AppState>) -> Result<(), AppError> {
|
||||
// SearchDb is already initialized during app setup; this is a no-op
|
||||
// but allows the frontend to confirm readiness.
|
||||
let _db = &state.search_db;
|
||||
|
|
@ -15,13 +16,14 @@ pub fn search_query(
|
|||
state: State<'_, AppState>,
|
||||
query: String,
|
||||
limit: Option<i32>,
|
||||
) -> Result<Vec<SearchResult>, String> {
|
||||
) -> Result<Vec<SearchResult>, AppError> {
|
||||
state.search_db.search_all(&query, limit.unwrap_or(20))
|
||||
.map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn search_rebuild(state: State<'_, AppState>) -> Result<(), String> {
|
||||
state.search_db.rebuild_index()
|
||||
pub fn search_rebuild(state: State<'_, AppState>) -> Result<(), AppError> {
|
||||
state.search_db.rebuild_index().map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
|
@ -30,8 +32,9 @@ pub fn search_index_message(
|
|||
session_id: String,
|
||||
role: String,
|
||||
content: String,
|
||||
) -> Result<(), String> {
|
||||
) -> Result<(), AppError> {
|
||||
state.search_db.index_message(&session_id, &role, &content)
|
||||
.map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
|
@ -42,8 +45,9 @@ pub fn search_index_task(
|
|||
description: String,
|
||||
status: String,
|
||||
assigned_to: String,
|
||||
) -> Result<(), String> {
|
||||
) -> Result<(), AppError> {
|
||||
state.search_db.index_task(&task_id, &title, &description, &status, &assigned_to)
|
||||
.map_err(AppError::database)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
|
@ -54,6 +58,7 @@ pub fn search_index_btmsg(
|
|||
to_agent: String,
|
||||
content: String,
|
||||
channel: String,
|
||||
) -> Result<(), String> {
|
||||
) -> Result<(), AppError> {
|
||||
state.search_db.index_btmsg(&msg_id, &from_agent, &to_agent, &content, &channel)
|
||||
.map_err(AppError::database)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue