swadhinbiswas Initial release v0.1.0 · 1/16/2026
ed7a4e4
15 lines · 341 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use tauri::State;
use crate::api::{ChanClient, Thread, thread_endpoint};

#[tauri::command]
pub async fn fetch_thread(
    board: String,
    thread_id: u64,
    client: State<'_, ChanClient>
) -> Result<Thread, String> {
    client
        .get_json(&thread_endpoint(&board, thread_id))
        .await
        .map_err(|e| e.to_string())
}