Separates controllers (api/, the #[server] endpoints) from business services (server/services/), background scheduling (server/jobs/, renamed from pipeline.rs), infra bootstrap/config (server/mod.rs, server/config.rs), and view components (app/), each one file per responsibility instead of the previous server.rs/app.rs/pipeline.rs grab-bags. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoXS1ERDGC1P189RqmUxAF
12 lines
473 B
Rust
12 lines
473 B
Rust
use dioxus::prelude::*;
|
|
|
|
/// Registers a feed and fetches it immediately. Runs on the server (native,
|
|
/// has DB + network access); the `#[server]` macro generates the HTTP call
|
|
/// the browser/WASM build uses instead.
|
|
#[server]
|
|
pub async fn subscribe_feed(url: String) -> Result<usize, ServerFnError> {
|
|
let db = crate::server::db().await?;
|
|
crate::server::services::feeds::subscribe(db, url)
|
|
.await
|
|
.map_err(|e| ServerFnError::new(e.to_string()))
|
|
}
|